Ejemplo n.º 1
0
 /**
  * @param  ChildPurchaseDetail $purchase The ChildPurchaseDetail object to remove.
  * @return $this|ChildStock The current object (for fluent API support)
  */
 public function removePurchase(ChildPurchaseDetail $purchase)
 {
     if ($this->getPurchases()->contains($purchase)) {
         $pos = $this->collPurchases->search($purchase);
         $this->collPurchases->remove($pos);
         if (null === $this->purchasesScheduledForDeletion) {
             $this->purchasesScheduledForDeletion = clone $this->collPurchases;
             $this->purchasesScheduledForDeletion->clear();
         }
         $this->purchasesScheduledForDeletion[] = $purchase;
         $purchase->setStock(null);
     }
     return $this;
 }
Ejemplo n.º 2
0
 /**
  * @param  ChildPurchaseDetail $purchaseDetail The ChildPurchaseDetail object to remove.
  * @return $this|ChildNotification The current object (for fluent API support)
  */
 public function removePurchaseDetail(ChildPurchaseDetail $purchaseDetail)
 {
     if ($this->getPurchaseDetails()->contains($purchaseDetail)) {
         $pos = $this->collPurchaseDetails->search($purchaseDetail);
         $this->collPurchaseDetails->remove($pos);
         if (null === $this->purchaseDetailsScheduledForDeletion) {
             $this->purchaseDetailsScheduledForDeletion = clone $this->collPurchaseDetails;
             $this->purchaseDetailsScheduledForDeletion->clear();
         }
         $this->purchaseDetailsScheduledForDeletion[] = $purchaseDetail;
         $purchaseDetail->setNotification(null);
     }
     return $this;
 }