Last active
August 29, 2015 14:16
-
-
Save ricfrank/f99c06d8d829bd47ad3c to your computer and use it in GitHub Desktop.
This file contains 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 Order | |
{ | |
private $orderId; | |
private $state; | |
private $total; | |
private $creationDate; | |
private $items = array(); | |
private $buyer; | |
... | |
public function renderOrderFound() | |
{ | |
$orderFoundViewModel = new OrderFoundViewModel() | |
$orderFoundViewModel->orderId = $this->getOrderId(); | |
$orderFoundViewModel->state = $this->getState(), | |
$orderFoundViewModel->orderCreationDate = $this->getCreationDate(), | |
$orderFoundViewModel->total = $this->getTotal(); | |
}; | |
foreach ($this->getItems() as $item) { | |
$orderFoundViewModel->items[] = $item; | |
} | |
return $orderFoundViewModel; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment