/**
  * 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->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);
                 }
             }
         }
         $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->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КалендарьRelatedByдатавыдачи !== null) {
             if ($this->aКалендарьRelatedByдатавыдачи->isModified() || $this->aКалендарьRelatedByдатавыдачи->isNew()) {
                 $affectedRows += $this->aКалендарьRelatedByдатавыдачи->save($con);
             }
             $this->setКалендарьRelatedByдатавыдачи($this->aКалендарьRelatedByдатавыдачи);
         }
         if ($this->aКонтролирующиеОрганы !== null) {
             if ($this->aКонтролирующиеОрганы->isModified() || $this->aКонтролирующиеОрганы->isNew()) {
                 $affectedRows += $this->aКонтролирующиеОрганы->save($con);
             }
             $this->setКонтролирующиеОрганы($this->aКонтролирующиеОрганы);
         }
         if ($this->aКалендарьRelatedByплановаядатаустранения !== null) {
             if ($this->aКалендарьRelatedByплановаядатаустранения->isModified() || $this->aКалендарьRelatedByплановаядатаустранения->isNew()) {
                 $affectedRows += $this->aКалендарьRelatedByплановаядатаустранения->save($con);
             }
             $this->setКалендарьRelatedByплановаядатаустранения($this->aКалендарьRelatedByплановаядатаустранения);
         }
         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->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КалендарьRelatedByфактическаядатаустранения !== null) {
             if ($this->aКалендарьRelatedByфактическаядатаустранения->isModified() || $this->aКалендарьRelatedByфактическаядатаустранения->isNew()) {
                 $affectedRows += $this->aКалендарьRelatedByфактическаядатаустранения->save($con);
             }
             $this->setКалендарьRelatedByфактическаядатаустранения($this->aКалендарьRelatedByфактическаядатаустранения);
         }
         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;
 }