Skip to content

Instantly share code, notes, and snippets.

@ricfrank
Last active August 29, 2015 14:16
Show Gist options
  • Save ricfrank/f99c06d8d829bd47ad3c to your computer and use it in GitHub Desktop.
Save ricfrank/f99c06d8d829bd47ad3c to your computer and use it in GitHub Desktop.
<?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