/** * Remove variant * * @param QuoteVariantInterface $variant * @return bool */ public function removeVariant(QuoteVariantInterface $variant) { $variant->setQuote(); $return = $this->variants->removeElement($variant); $i = 0; foreach ($this->variants as $v) { $v->setVariantNumber(++$i); } return $return; }
public function assertState(QuoteVariantInterface $variant, $states = array()) { if (!in_array($variant->getState(), $states)) { throw new Exception('This action is impossible with the actual quote state'); } }