Created
October 18, 2018 11:54
-
-
Save yourwebmaker/3384e9deed550322f706c1312b64e170 to your computer and use it in GitHub Desktop.
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 | |
namespace OrderExample | |
{ | |
interface Order | |
{ | |
public static function create(OrderId $orderId, DateTimeImmutable $orderDate) : Order; | |
public function addLine(LineNumber $lineId, ProductId $productId, Quantity $quantity) : void; | |
} | |
class OrderTalisORM implements Order | |
{ | |
public static function create(OrderId $orderId, DateTimeImmutable $orderDate) : Order | |
{ | |
//custom code for Doctrine implementation | |
} | |
public function addLine(LineNumber $lineId, ProductId $productId, Quantity $quantity) : void | |
{ | |
//custom code for Doctrine implementation | |
} | |
} | |
class OrderDoctrine implements Order | |
{ | |
public static function create(OrderId $orderId, DateTimeImmutable $orderDate) : Order | |
{ | |
//custom code for Doctrine implementation | |
} | |
public function addLine(LineNumber $lineId, ProductId $productId, Quantity $quantity) : void | |
{ | |
//custom code for Doctrine implementation | |
} | |
} | |
class OrderProoph implements Order | |
{ | |
public static function create(OrderId $orderId, DateTimeImmutable $orderDate) : Order | |
{ | |
// ES implementation | |
} | |
public function addLine(LineNumber $lineId, ProductId $productId, Quantity $quantity) : void | |
{ | |
// ES implementation | |
} | |
public function apply(ProofEventInterface $event) | |
{ | |
//big ugly switch for AR events | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment