/** * Performs the work of inserting or updating the row in the database. * * If the object is new, it inserts it; otherwise an update is performed. * All related objects are also updated in this method. * * @param ConnectionInterface $con * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. * @throws PropelException * @see save() */ protected function doSave(ConnectionInterface $con) { $affectedRows = 0; // initialize var to track total num of affected rows if (!$this->alreadyInSave) { $this->alreadyInSave = true; // We call the save method on the following object(s) if they // were passed to this object by their corresponding set // method. This object relates to these object(s) by a // foreign key reference. if ($this->aпрограммы !== null) { if ($this->aпрограммы->isModified() || $this->aпрограммы->isNew()) { $affectedRows += $this->aпрограммы->save($con); } $this->setпрограммы($this->aпрограммы); } if ($this->aмесяца !== null) { if ($this->aмесяца->isModified() || $this->aмесяца->isNew()) { $affectedRows += $this->aмесяца->save($con); } $this->setмесяца($this->aмесяца); } if ($this->aгода !== null) { if ($this->aгода->isModified() || $this->aгода->isNew()) { $affectedRows += $this->aгода->save($con); } $this->setгода($this->aгода); } if ($this->isNew() || $this->isModified()) { // persist changes if ($this->isNew()) { $this->doInsert($con); $affectedRows += 1; } else { $affectedRows += $this->doUpdate($con); } $this->resetModified(); } $this->alreadyInSave = false; } return $affectedRows; }
/** * Performs the work of inserting or updating the row in the database. * * If the object is new, it inserts it; otherwise an update is performed. * All related objects are also updated in this method. * * @param ConnectionInterface $con * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations. * @throws PropelException * @see save() */ protected function doSave(ConnectionInterface $con) { $affectedRows = 0; // initialize var to track total num of affected rows if (!$this->alreadyInSave) { $this->alreadyInSave = true; // We call the save method on the following object(s) if they // were passed to this object by their corresponding set // method. This object relates to these object(s) by a // foreign key reference. if ($this->aгода !== null) { if ($this->aгода->isModified() || $this->aгода->isNew()) { $affectedRows += $this->aгода->save($con); } $this->setгода($this->aгода); } if ($this->aднинедели !== null) { if ($this->aднинедели->isModified() || $this->aднинедели->isNew()) { $affectedRows += $this->aднинедели->save($con); } $this->setднинедели($this->aднинедели); } if ($this->aмесяца !== null) { if ($this->aмесяца->isModified() || $this->aмесяца->isNew()) { $affectedRows += $this->aмесяца->save($con); } $this->setмесяца($this->aмесяца); } if ($this->isNew() || $this->isModified()) { // persist changes if ($this->isNew()) { $this->doInsert($con); $affectedRows += 1; } else { $affectedRows += $this->doUpdate($con); } $this->resetModified(); } if ($this->�ыработкаsScheduledForDeletion !== null) { if (!$this->�ыработкаsScheduledForDeletion->isEmpty()) { \выработкаQuery::create()->filterByPrimaryKeys($this->�ыработкаsScheduledForDeletion->getPrimaryKeys(false))->delete($con); $this->�ыработкаsScheduledForDeletion = null; } } if ($this->collвыработкаs !== null) { foreach ($this->collвыработкаs as $referrerFK) { if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) { $affectedRows += $referrerFK->save($con); } } } if ($this->�атыобновленийдашбордовsScheduledForDeletion !== null) { if (!$this->�атыобновленийдашбордовsScheduledForDeletion->isEmpty()) { \датыобновленийдашбордовQuery::create()->filterByPrimaryKeys($this->�атыобновленийдашбордовsScheduledForDeletion->getPrimaryKeys(false))->delete($con); $this->�атыобновленийдашбордовsScheduledForDeletion = null; } } if ($this->collдатыобновленийдашбордовs !== null) { foreach ($this->collдатыобновленийдашбордовs as $referrerFK) { if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) { $affectedRows += $referrerFK->save($con); } } } if ($this->�трsScheduledForDeletion !== null) { if (!$this->�трsScheduledForDeletion->isEmpty()) { \мтрQuery::create()->filterByPrimaryKeys($this->�трsScheduledForDeletion->getPrimaryKeys(false))->delete($con); $this->�трsScheduledForDeletion = null; } } if ($this->collмтрs !== null) { foreach ($this->collмтрs as $referrerFK) { if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) { $affectedRows += $referrerFK->save($con); } } } if ($this->�обилизацияsScheduledForDeletion !== null) { if (!$this->�обилизацияsScheduledForDeletion->isEmpty()) { \мобилизацияQuery::create()->filterByPrimaryKeys($this->�обилизацияsScheduledForDeletion->getPrimaryKeys(false))->delete($con); $this->�обилизацияsScheduledForDeletion = null; } } if ($this->collмобилизацияs !== null) { foreach ($this->collмобилизацияs as $referrerFK) { if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) { $affectedRows += $referrerFK->save($con); } } } if ($this->�обилизацияпомесяцамsScheduledForDeletion !== null) { if (!$this->�обилизацияпомесяцамsScheduledForDeletion->isEmpty()) { \мобилизацияпомесяцамQuery::create()->filterByPrimaryKeys($this->�обилизацияпомесяцамsScheduledForDeletion->getPrimaryKeys(false))->delete($con); $this->�обилизацияпомесяцамsScheduledForDeletion = null; } } if ($this->collмобилизацияпомесяцамs !== null) { foreach ($this->collмобилизацияпомесяцамs as $referrerFK) { if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) { $affectedRows += $referrerFK->save($con); } } } if ($this->�редписанияsRelatedByдатавыдачиScheduledForDeletion !== null) { if (!$this->�редписанияsRelatedByдатавыдачиScheduledForDeletion->isEmpty()) { \ПредписанияQuery::create()->filterByPrimaryKeys($this->�редписанияsRelatedByдатавыдачиScheduledForDeletion->getPrimaryKeys(false))->delete($con); $this->�редписанияsRelatedByдатавыдачиScheduledForDeletion = null; } } if ($this->collПредписанияsRelatedByдатавыдачи !== null) { foreach ($this->collПредписанияsRelatedByдатавыдачи as $referrerFK) { if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) { $affectedRows += $referrerFK->save($con); } } } if ($this->�редписанияsRelatedByплановаядатаустраненияScheduledForDeletion !== null) { if (!$this->�редписанияsRelatedByплановаядатаустраненияScheduledForDeletion->isEmpty()) { \ПредписанияQuery::create()->filterByPrimaryKeys($this->�редписанияsRelatedByплановаядатаустраненияScheduledForDeletion->getPrimaryKeys(false))->delete($con); $this->�редписанияsRelatedByплановаядатаустраненияScheduledForDeletion = null; } } if ($this->collПредписанияsRelatedByплановаядатаустранения !== null) { foreach ($this->collПредписанияsRelatedByплановаядатаустранения as $referrerFK) { if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) { $affectedRows += $referrerFK->save($con); } } } if ($this->�редписанияsRelatedByфактическаядатаустраненияScheduledForDeletion !== null) { if (!$this->�редписанияsRelatedByфактическаядатаустраненияScheduledForDeletion->isEmpty()) { foreach ($this->�редписанияsRelatedByфактическаядатаустраненияScheduledForDeletion as $�редписанияRelatedByфактическаядатаустранения) { // need to save related object because we set the relation to null $�редписанияRelatedByфактическаядатаустранения->save($con); } $this->�редписанияsRelatedByфактическаядатаустраненияScheduledForDeletion = null; } } if ($this->collПредписанияsRelatedByфактическаядатаустранения !== null) { foreach ($this->collПредписанияsRelatedByфактическаядатаустранения as $referrerFK) { if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) { $affectedRows += $referrerFK->save($con); } } } if ($this->�изическиеобъёмыsScheduledForDeletion !== null) { if (!$this->�изическиеобъёмыsScheduledForDeletion->isEmpty()) { \физическиеобъёмыQuery::create()->filterByPrimaryKeys($this->�изическиеобъёмыsScheduledForDeletion->getPrimaryKeys(false))->delete($con); $this->�изическиеобъёмыsScheduledForDeletion = null; } } if ($this->collфизическиеобъёмыs !== null) { foreach ($this->collфизическиеобъёмыs as $referrerFK) { if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) { $affectedRows += $referrerFK->save($con); } } } $this->alreadyInSave = false; } return $affectedRows; }