WellCommerce\Bundle\ClientBundle\Entity\ClientInterface::getOrders PHP Method

getOrders() public method

public getOrders ( ) : Doctrine\Common\Collections\Collection
return Doctrine\Common\Collections\Collection
    public function getOrders() : Collection;

Usage Example

 /**
  * Calculates client's orders total value
  *
  * @param ClientInterface $client
  *
  * @return int|float
  */
 protected function calculateOrdersAmountForClient(ClientInterface $client)
 {
     $total = 0;
     $client->getOrders()->map(function (OrderInterface $order) use(&$total) {
         $total += $this->convertAmount($order);
     });
     return $total;
 }