Beispiel #1
0
 /**
  * @param \Propel\Runtime\Collection\ObjectCollection $entities
  * @param \Orm\Zed\Customer\Persistence\SpyCustomer $customer
  *
  * @return \Generated\Shared\Transfer\AddressesTransfer
  */
 protected function entityCollectionToTransferCollection(ObjectCollection $entities, SpyCustomer $customer)
 {
     $addressCollection = new AddressesTransfer();
     foreach ($entities->getData() as $address) {
         $addressTransfer = $this->entityToTransfer($address);
         if ($customer->getDefaultBillingAddress() === $address->getIdCustomerAddress()) {
             $addressTransfer->setIsDefaultBilling(true);
         }
         if ($customer->getDefaultShippingAddress() === $address->getIdCustomerAddress()) {
             $addressTransfer->setIsDefaultShipping(true);
         }
         $addressCollection->addAddress($addressTransfer);
     }
     return $addressCollection;
 }
Beispiel #2
0
 /**
  * @param \Propel\Runtime\Collection\ObjectCollection $entities
  *
  * @return \Generated\Shared\Transfer\AddressesTransfer
  */
 protected function entityCollectionToTransferCollection(ObjectCollection $entities)
 {
     $addressTransferCollection = new AddressesTransfer();
     foreach ($entities->getData() as $entity) {
         $addressTransferCollection->addAddress($this->entityToAddressTransfer($entity));
     }
     return $addressTransferCollection;
 }