setOrderId(null); } else { $this->setOrderId($v->getId()); } $this->aOrder = $v; // Add binding for other direction of this n:n relationship. // If this object has already been added to the ChildCustomer object, it will not be re-added. if (method_exists($v, 'addCreditNote') && $v !== null) { $v->addCreditNote($this); } return $this; } /** * Declares an association between this object and a ChildCurrency object. * * @param Currency $v * @return \CreditNote\Model\CreditNote The current object (for fluent API support) * @throws PropelException */ public function setCurrency(Currency $v = null) { if ($v === null) { $this->setCurrencyId(null); } else { $this->setCurrencyId($v->getId()); } $this->aCurrency = $v; // Add binding for other direction of this n:n relationship. // If this object has already been added to the ChildCustomer object, it will not be re-added. if (method_exists($v, 'addCreditNote') && $v !== null) { $v->addCreditNote($this); } return $this; } /** * Declares an association between this object and a ChildCustomer object. * * @param Customer $v * @return \CreditNote\Model\CreditNote The current object (for fluent API support) * @throws PropelException */ public function setCustomer(Customer $v = null) { if ($v === null) { $this->setCustomerId(null); } else { $this->setCustomerId($v->getId()); } $this->aCustomer = $v; // Add binding for other direction of this n:n relationship. // If this object has already been added to the ChildCustomer object, it will not be re-added. if (method_exists($v, 'addCreditNote') && $v !== null) { $v->addCreditNote($this); } return $this; } public function setStatusId($v) { // check status flow if (null !== $this->getStatusId() && (int) $v !== (int) $this->getStatusId()) { if (!CreditNoteStatusFlowQuery::create() ->filterByFromStatusId($this->getStatusId()) ->filterByToStatusId($v) ->findOne()) { throw new \Exception('You do not respect the status flow'); } } return parent::setStatusId($v); } public function setCreditNoteStatus(ChildCreditNoteStatus $v = null) { // check status flow if (null !== $v && null !== $this->getCreditNoteStatus() && (int) $v->getId() !== (int) $this->getCreditNoteStatus()->getId()) { if (!CreditNoteStatusFlowQuery::create() ->filterByFromStatusId($this->getCreditNoteStatus()->getId()) ->filterByToStatusId($v->getId()) ->findOne()) { throw new \Exception('You do not respect the status flow'); } } return parent::setCreditNoteStatus($v); } }