コード例 #1
0
ファイル: Order.php プロジェクト: Hsidhu/Sylius
 /**
  * {@inheritdoc}
  */
 public function removeAdjustment(AdjustmentInterface $adjustment)
 {
     if (!$adjustment->isLocked() && $this->hasAdjustment($adjustment)) {
         $adjustment->setAdjustable(null);
         $this->adjustments->removeElement($adjustment);
     }
 }
コード例 #2
0
ファイル: OrderItem.php プロジェクト: bcremer/Sylius
 /**
  * {@inheritdoc}
  */
 public function removeAdjustment(AdjustmentInterface $adjustment)
 {
     if ($this->hasAdjustment($adjustment)) {
         $adjustment->setAdjustable(null);
         $this->adjustments->removeElement($adjustment);
     }
     return $this;
 }
コード例 #3
0
ファイル: OrderItemUnit.php プロジェクト: sylius/order
 /**
  * {@inheritdoc}
  */
 public function removeAdjustment(AdjustmentInterface $adjustment)
 {
     if ($adjustment->isLocked() || !$this->hasAdjustment($adjustment)) {
         return;
     }
     $this->adjustments->removeElement($adjustment);
     $this->subtractFromAdjustmentsTotal($adjustment);
     $this->orderItem->recalculateUnitsTotal();
     $adjustment->setAdjustable(null);
 }
コード例 #4
0
ファイル: OrderItem.php プロジェクト: kongqingfu/Sylius
 /**
  * {@inheritdoc}
  */
 public function removeAdjustments($type)
 {
     foreach ($this->getAdjustments($type) as $adjustment) {
         if ($adjustment->isLocked()) {
             continue;
         }
         $adjustment->setAdjustable(null);
         $this->adjustments->removeElement($adjustment);
     }
 }