This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class HookService | |
{ | |
public function TrackingHookService() | |
{ | |
$subscriber1 = new Subscriber("http://listener1.com/listenurl",000); | |
$subscriber2 = new Subscriber("http://listener2.com/listenurl",999); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
////1- Öncelikle ödeme için bir base tanımlayalım | |
interface IPayment | |
{ | |
public function pay(); | |
} | |
//2- Farklı Ödeme tiplerine göre implenetasyonları uygulayalım | |
class PayWithCard implements IPayment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
////Pusedio kodlar | |
class BusinessLayer | |
{ | |
public function ManageProduct() | |
{ | |
////Myslq Server Kullanmak istediğimizde | |
$productManager = new ProductManager( new MysqlAdapter()); | |
$productManager->getData($query,$params); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class BusinessLayer | |
{ | |
public function UserRegister(Request $request) | |
{ | |
$userManager = new UserManagerFacade(); | |
$userManager->SaveUser($request->user); | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function registerOrder($order) | |
{ | |
try | |
{ | |
//formu validate edelim | |
if(!isValidForm()) throw new Exception("Form bilgileri doğrulanamadı", 403); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function registerOrder($order) | |
{ | |
//formu validate edelim | |
if(!isValidForm()) | |
{ | |
return json_encode(["status"=>false, "error"=>"Form bilgileri doğrulanamadı"]]) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
interface IMessage | |
{ | |
public function sendMessage(); | |
} | |
////low Level sınıflarımız |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
////low Level sınıflarımız | |
class Email | |
{ | |
function sendEmail(); | |
} | |
class SMS | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
interface IReadable | |
{ | |
public function read(); | |
} | |
interface ICreatable | |
{ | |
public function create(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
interface IUserActions | |
{ | |
public function create(); | |
public function read(); | |
public function update(); | |
public function delete(); | |
} | |
NewerOlder