Example #1
0
 /**
  * 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      PropelPDO $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(PropelPDO $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 coresponding set
         // method.  This object relates to these object(s) by a
         // foreign key reference.
         if ($this->aUser !== null) {
             if ($this->aUser->isModified() || $this->aUser->isNew()) {
                 $affectedRows += $this->aUser->save($con);
             }
             $this->setUser($this->aUser);
         }
         if ($this->isNew() || $this->isModified()) {
             // persist changes
             if ($this->isNew()) {
                 $this->doInsert($con);
             } else {
                 $this->doUpdate($con);
             }
             $affectedRows += 1;
             $this->resetModified();
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }
Example #2
0
 /**
  * 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      PropelPDO $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(PropelPDO $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 coresponding set
         // method.  This object relates to these object(s) by a
         // foreign key reference.
         if ($this->aUserRelatedByLeadId !== null) {
             if ($this->aUserRelatedByLeadId->isModified() || $this->aUserRelatedByLeadId->isNew()) {
                 $affectedRows += $this->aUserRelatedByLeadId->save($con);
             }
             $this->setUserRelatedByLeadId($this->aUserRelatedByLeadId);
         }
         if ($this->aUserRelatedByUserId !== null) {
             if ($this->aUserRelatedByUserId->isModified() || $this->aUserRelatedByUserId->isNew()) {
                 $affectedRows += $this->aUserRelatedByUserId->save($con);
             }
             $this->setUserRelatedByUserId($this->aUserRelatedByUserId);
         }
         if ($this->isNew()) {
             $this->modifiedColumns[] = ProjectPeer::ID;
         }
         // If this object has been modified, then save it to the database.
         if ($this->isModified()) {
             if ($this->isNew()) {
                 $pk = ProjectPeer::doInsert($this, $con);
                 $affectedRows += 1;
                 // we are assuming that there is only 1 row per doInsert() which
                 // should always be true here (even though technically
                 // BasePeer::doInsert() can insert multiple rows).
                 $this->setId($pk);
                 //[IMV] update autoincrement primary key
                 $this->setNew(false);
             } else {
                 $affectedRows += ProjectPeer::doUpdate($this, $con);
             }
             $this->resetModified();
             // [HL] After being saved an object is no longer 'modified'
         }
         if ($this->collTasks !== null) {
             foreach ($this->collTasks as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->collBuilds !== null) {
             foreach ($this->collBuilds as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }
Example #3
0
 /**
  * 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      PropelPDO $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(PropelPDO $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 coresponding set
         // method.  This object relates to these object(s) by a
         // foreign key reference.
         if ($this->aUser !== null) {
             if ($this->aUser->isModified() || $this->aUser->isNew()) {
                 $affectedRows += $this->aUser->save($con);
             }
             $this->setUser($this->aUser);
         }
         // If this object has been modified, then save it to the database.
         if ($this->isModified()) {
             if ($this->isNew()) {
                 $criteria = $this->buildCriteria();
                 $pk = BasePeer::doInsert($criteria, $con);
                 $affectedRows += 1;
                 $this->setNew(false);
             } else {
                 $affectedRows += WebdavLockPeer::doUpdate($this, $con);
             }
             $this->resetModified();
             // [HL] After being saved an object is no longer 'modified'
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }
Example #4
0
 /**
  * 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      PropelPDO $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(PropelPDO $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 coresponding set
         // method.  This object relates to these object(s) by a
         // foreign key reference.
         if ($this->aUser !== null) {
             if ($this->aUser->isModified() || $this->aUser->isNew()) {
                 $affectedRows += $this->aUser->save($con);
             }
             $this->setUser($this->aUser);
         }
         // If this object has been modified, then save it to the database.
         if ($this->isModified()) {
             if ($this->isNew()) {
                 $pk = UserFbPeer::doInsert($this, $con);
                 $affectedRows += 1;
                 // we are assuming that there is only 1 row per doInsert() which
                 // should always be true here (even though technically
                 // BasePeer::doInsert() can insert multiple rows).
                 $this->setNew(false);
             } else {
                 $affectedRows += UserFbPeer::doUpdate($this, $con);
             }
             $this->resetModified();
             // [HL] After being saved an object is no longer 'modified'
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }
 /**
  * Stores the object 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      Connection $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($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 coresponding set
         // method.  This object relates to these object(s) by a
         // foreign key reference.
         if ($this->aUserRelatedByCreatedUserId !== null) {
             if ($this->aUserRelatedByCreatedUserId->isModified()) {
                 $affectedRows += $this->aUserRelatedByCreatedUserId->save($con);
             }
             $this->setUserRelatedByCreatedUserId($this->aUserRelatedByCreatedUserId);
         }
         if ($this->aUserRelatedByUpdatedUserId !== null) {
             if ($this->aUserRelatedByUpdatedUserId->isModified()) {
                 $affectedRows += $this->aUserRelatedByUpdatedUserId->save($con);
             }
             $this->setUserRelatedByUpdatedUserId($this->aUserRelatedByUpdatedUserId);
         }
         if ($this->aVocabulary !== null) {
             if ($this->aVocabulary->isModified()) {
                 $affectedRows += $this->aVocabulary->save($con);
             }
             $this->setVocabulary($this->aVocabulary);
         }
         if ($this->aStatus !== null) {
             if ($this->aStatus->isModified()) {
                 $affectedRows += $this->aStatus->save($con);
             }
             $this->setStatus($this->aStatus);
         }
         // If this object has been modified, then save it to the database.
         if ($this->isModified()) {
             if ($this->isNew()) {
                 $pk = CollectionPeer::doInsert($this, $con);
                 $affectedRows += 1;
                 // we are assuming that there is only 1 row per doInsert() which
                 // should always be true here (even though technically
                 // BasePeer::doInsert() can insert multiple rows).
                 $this->setId($pk);
                 //[IMV] update autoincrement primary key
                 $this->setNew(false);
             } else {
                 $affectedRows += CollectionPeer::doUpdate($this, $con);
             }
             $this->resetModified();
             // [HL] After being saved an object is no longer 'modified'
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }
Example #6
0
 /**
  * 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 PropelPDO $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(PropelPDO $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->aUserRelatedByCreatedBy !== null) {
             if ($this->aUserRelatedByCreatedBy->isModified() || $this->aUserRelatedByCreatedBy->isNew()) {
                 $affectedRows += $this->aUserRelatedByCreatedBy->save($con);
             }
             $this->setUserRelatedByCreatedBy($this->aUserRelatedByCreatedBy);
         }
         if ($this->aUserRelatedByUpdatedBy !== null) {
             if ($this->aUserRelatedByUpdatedBy->isModified() || $this->aUserRelatedByUpdatedBy->isNew()) {
                 $affectedRows += $this->aUserRelatedByUpdatedBy->save($con);
             }
             $this->setUserRelatedByUpdatedBy($this->aUserRelatedByUpdatedBy);
         }
         if ($this->isNew() || $this->isModified()) {
             // persist changes
             if ($this->isNew()) {
                 $this->doInsert($con);
             } else {
                 $this->doUpdate($con);
             }
             $affectedRows += 1;
             // Rewind the data LOB column, since PDO does not rewind after inserting value.
             if ($this->data !== null && is_resource($this->data)) {
                 rewind($this->data);
             }
             $this->resetModified();
         }
         if ($this->documentsScheduledForDeletion !== null) {
             if (!$this->documentsScheduledForDeletion->isEmpty()) {
                 DocumentQuery::create()->filterByPrimaryKeys($this->documentsScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->documentsScheduledForDeletion = null;
             }
         }
         if ($this->collDocuments !== null) {
             foreach ($this->collDocuments 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 PropelPDO $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(PropelPDO $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->aContentObject !== null) {
             if ($this->aContentObject->isModified() || $this->aContentObject->isNew()) {
                 $affectedRows += $this->aContentObject->save($con);
             }
             $this->setContentObject($this->aContentObject);
         }
         if ($this->aLanguage !== null) {
             if ($this->aLanguage->isModified() || $this->aLanguage->isNew()) {
                 $affectedRows += $this->aLanguage->save($con);
             }
             $this->setLanguage($this->aLanguage);
         }
         if ($this->aUserRelatedByCreatedBy !== null) {
             if ($this->aUserRelatedByCreatedBy->isModified() || $this->aUserRelatedByCreatedBy->isNew()) {
                 $affectedRows += $this->aUserRelatedByCreatedBy->save($con);
             }
             $this->setUserRelatedByCreatedBy($this->aUserRelatedByCreatedBy);
         }
         if ($this->aUserRelatedByUpdatedBy !== null) {
             if ($this->aUserRelatedByUpdatedBy->isModified() || $this->aUserRelatedByUpdatedBy->isNew()) {
                 $affectedRows += $this->aUserRelatedByUpdatedBy->save($con);
             }
             $this->setUserRelatedByUpdatedBy($this->aUserRelatedByUpdatedBy);
         }
         if ($this->isNew() || $this->isModified()) {
             // persist changes
             if ($this->isNew()) {
                 $this->doInsert($con);
             } else {
                 $this->doUpdate($con);
             }
             $affectedRows += 1;
             // Rewind the data LOB column, since PDO does not rewind after inserting value.
             if ($this->data !== null && is_resource($this->data)) {
                 rewind($this->data);
             }
             $this->resetModified();
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }
Example #8
0
 /**
  * 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 PropelPDO $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(PropelPDO $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->aUserRelatedByCreatedBy !== null) {
             if ($this->aUserRelatedByCreatedBy->isModified() || $this->aUserRelatedByCreatedBy->isNew()) {
                 $affectedRows += $this->aUserRelatedByCreatedBy->save($con);
             }
             $this->setUserRelatedByCreatedBy($this->aUserRelatedByCreatedBy);
         }
         if ($this->aUserRelatedByUpdatedBy !== null) {
             if ($this->aUserRelatedByUpdatedBy->isModified() || $this->aUserRelatedByUpdatedBy->isNew()) {
                 $affectedRows += $this->aUserRelatedByUpdatedBy->save($con);
             }
             $this->setUserRelatedByUpdatedBy($this->aUserRelatedByUpdatedBy);
         }
         if ($this->isNew() || $this->isModified()) {
             // persist changes
             if ($this->isNew()) {
                 $this->doInsert($con);
             } else {
                 $this->doUpdate($con);
             }
             $affectedRows += 1;
             $this->resetModified();
         }
         if ($this->documentsScheduledForDeletion !== null) {
             if (!$this->documentsScheduledForDeletion->isEmpty()) {
                 foreach ($this->documentsScheduledForDeletion as $document) {
                     // need to save related object because we set the relation to null
                     $document->save($con);
                 }
                 $this->documentsScheduledForDeletion = null;
             }
         }
         if ($this->collDocuments !== null) {
             foreach ($this->collDocuments as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }
Example #9
0
 /**
  * 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      PropelPDO $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(PropelPDO $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 coresponding set
         // method.  This object relates to these object(s) by a
         // foreign key reference.
         if ($this->aUser !== null) {
             if ($this->aUser->isModified() || $this->aUser->isNew()) {
                 $affectedRows += $this->aUser->save($con);
             }
             $this->setUser($this->aUser);
         }
         if ($this->isNew() || $this->isModified()) {
             // persist changes
             if ($this->isNew()) {
                 $this->doInsert($con);
             } else {
                 $this->doUpdate($con);
             }
             $affectedRows += 1;
             // Rewind the data LOB column, since PDO does not rewind after inserting value.
             if ($this->data !== null && is_resource($this->data)) {
                 rewind($this->data);
             }
             $this->resetModified();
         }
         if ($this->singleSignOnKeysScheduledForDeletion !== null) {
             if (!$this->singleSignOnKeysScheduledForDeletion->isEmpty()) {
                 foreach ($this->singleSignOnKeysScheduledForDeletion as $singleSignOnKey) {
                     // need to save related object because we set the relation to null
                     $singleSignOnKey->save($con);
                 }
                 $this->singleSignOnKeysScheduledForDeletion = null;
             }
         }
         if ($this->collSingleSignOnKeys !== null) {
             foreach ($this->collSingleSignOnKeys as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $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      PropelPDO $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(PropelPDO $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 coresponding set
         // method.  This object relates to these object(s) by a
         // foreign key reference.
         if ($this->aSystemEvent !== null) {
             if ($this->aSystemEvent->isModified() || $this->aSystemEvent->isNew()) {
                 $affectedRows += $this->aSystemEvent->save($con);
             }
             $this->setSystemEvent($this->aSystemEvent);
         }
         if ($this->aUser !== null) {
             if ($this->aUser->isModified() || $this->aUser->isNew()) {
                 $affectedRows += $this->aUser->save($con);
             }
             $this->setUser($this->aUser);
         }
         if ($this->isNew() || $this->isModified()) {
             // persist changes
             if ($this->isNew()) {
                 $this->doInsert($con);
             } else {
                 $this->doUpdate($con);
             }
             $affectedRows += 1;
             $this->resetModified();
         }
         if ($this->systemEventInstanceMessagesScheduledForDeletion !== null) {
             if (!$this->systemEventInstanceMessagesScheduledForDeletion->isEmpty()) {
                 SystemEventInstanceMessageQuery::create()->filterByPrimaryKeys($this->systemEventInstanceMessagesScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->systemEventInstanceMessagesScheduledForDeletion = null;
             }
         }
         if ($this->collSystemEventInstanceMessages !== null) {
             foreach ($this->collSystemEventInstanceMessages as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $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      PropelPDO $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(PropelPDO $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 coresponding set
         // method.  This object relates to these object(s) by a
         // foreign key reference.
         if ($this->aGroup !== null) {
             if ($this->aGroup->isModified() || $this->aGroup->isNew()) {
                 $affectedRows += $this->aGroup->save($con);
             }
             $this->setGroup($this->aGroup);
         }
         if ($this->aUser !== null) {
             if ($this->aUser->isModified() || $this->aUser->isNew()) {
                 $affectedRows += $this->aUser->save($con);
             }
             $this->setUser($this->aUser);
         }
         if ($this->isNew()) {
             $this->modifiedColumns[] = DirectoryPermissionPeer::ID;
         }
         // If this object has been modified, then save it to the database.
         if ($this->isModified()) {
             if ($this->isNew()) {
                 $criteria = $this->buildCriteria();
                 if ($criteria->keyContainsValue(DirectoryPermissionPeer::ID)) {
                     throw new PropelException('Cannot insert a value for auto-increment primary key (' . DirectoryPermissionPeer::ID . ')');
                 }
                 $pk = BasePeer::doInsert($criteria, $con);
                 $affectedRows += 1;
                 $this->setId($pk);
                 //[IMV] update autoincrement primary key
                 $this->setNew(false);
             } else {
                 $affectedRows += DirectoryPermissionPeer::doUpdate($this, $con);
             }
             $this->resetModified();
             // [HL] After being saved an object is no longer 'modified'
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }
 public function testNewUserNotModified()
 {
     $user = new User();
     $this->assertTrue($user->id < 0);
     $this->assertFalse($user->isModified());
     $this->assertTrue($user->title->id < 0);
     $this->assertFalse($user->title->isModified());
 }
Example #13
0
 /**
  * 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 PropelPDO $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(PropelPDO $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->aPageRelatedByCanonicalId !== null) {
             if ($this->aPageRelatedByCanonicalId->isModified() || $this->aPageRelatedByCanonicalId->isNew()) {
                 $affectedRows += $this->aPageRelatedByCanonicalId->save($con);
             }
             $this->setPageRelatedByCanonicalId($this->aPageRelatedByCanonicalId);
         }
         if ($this->aUserRelatedByCreatedBy !== null) {
             if ($this->aUserRelatedByCreatedBy->isModified() || $this->aUserRelatedByCreatedBy->isNew()) {
                 $affectedRows += $this->aUserRelatedByCreatedBy->save($con);
             }
             $this->setUserRelatedByCreatedBy($this->aUserRelatedByCreatedBy);
         }
         if ($this->aUserRelatedByUpdatedBy !== null) {
             if ($this->aUserRelatedByUpdatedBy->isModified() || $this->aUserRelatedByUpdatedBy->isNew()) {
                 $affectedRows += $this->aUserRelatedByUpdatedBy->save($con);
             }
             $this->setUserRelatedByUpdatedBy($this->aUserRelatedByUpdatedBy);
         }
         if ($this->isNew() || $this->isModified()) {
             // persist changes
             if ($this->isNew()) {
                 $this->doInsert($con);
             } else {
                 $this->doUpdate($con);
             }
             $affectedRows += 1;
             $this->resetModified();
         }
         if ($this->pagesRelatedByIdScheduledForDeletion !== null) {
             if (!$this->pagesRelatedByIdScheduledForDeletion->isEmpty()) {
                 foreach ($this->pagesRelatedByIdScheduledForDeletion as $pageRelatedById) {
                     // need to save related object because we set the relation to null
                     $pageRelatedById->save($con);
                 }
                 $this->pagesRelatedByIdScheduledForDeletion = null;
             }
         }
         if ($this->collPagesRelatedById !== null) {
             foreach ($this->collPagesRelatedById as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->pagePropertysScheduledForDeletion !== null) {
             if (!$this->pagePropertysScheduledForDeletion->isEmpty()) {
                 PagePropertyQuery::create()->filterByPrimaryKeys($this->pagePropertysScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->pagePropertysScheduledForDeletion = null;
             }
         }
         if ($this->collPagePropertys !== null) {
             foreach ($this->collPagePropertys as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->pageStringsScheduledForDeletion !== null) {
             if (!$this->pageStringsScheduledForDeletion->isEmpty()) {
                 PageStringQuery::create()->filterByPrimaryKeys($this->pageStringsScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->pageStringsScheduledForDeletion = null;
             }
         }
         if ($this->collPageStrings !== null) {
             foreach ($this->collPageStrings as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->contentObjectsScheduledForDeletion !== null) {
             if (!$this->contentObjectsScheduledForDeletion->isEmpty()) {
                 ContentObjectQuery::create()->filterByPrimaryKeys($this->contentObjectsScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->contentObjectsScheduledForDeletion = null;
             }
         }
         if ($this->collContentObjects !== null) {
             foreach ($this->collContentObjects as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->rightsScheduledForDeletion !== null) {
             if (!$this->rightsScheduledForDeletion->isEmpty()) {
                 RightQuery::create()->filterByPrimaryKeys($this->rightsScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->rightsScheduledForDeletion = null;
             }
         }
         if ($this->collRights !== null) {
             foreach ($this->collRights as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }
Example #14
0
 /**
  * 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 PropelPDO $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(PropelPDO $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 coresponding set
         // method.  This object relates to these object(s) by a
         // foreign key reference.
         if ($this->aUserRelatedByCreatorId !== null) {
             if ($this->aUserRelatedByCreatorId->isModified() || $this->aUserRelatedByCreatorId->isNew()) {
                 $affectedRows += $this->aUserRelatedByCreatorId->save($con);
             }
             $this->setUserRelatedByCreatorId($this->aUserRelatedByCreatorId);
         }
         if ($this->aClockingType !== null) {
             if ($this->aClockingType->isModified() || $this->aClockingType->isNew()) {
                 $affectedRows += $this->aClockingType->save($con);
             }
             $this->setClockingType($this->aClockingType);
         }
         if ($this->aUserRelatedByUserId !== null) {
             if ($this->aUserRelatedByUserId->isModified() || $this->aUserRelatedByUserId->isNew()) {
                 $affectedRows += $this->aUserRelatedByUserId->save($con);
             }
             $this->setUserRelatedByUserId($this->aUserRelatedByUserId);
         }
         if ($this->isNew() || $this->isModified()) {
             // persist changes
             if ($this->isNew()) {
                 $this->doInsert($con);
             } else {
                 $this->doUpdate($con);
             }
             $affectedRows += 1;
             $this->resetModified();
         }
         if ($this->transactionClockingsScheduledForDeletion !== null) {
             if (!$this->transactionClockingsScheduledForDeletion->isEmpty()) {
                 TransactionClockingQuery::create()->filterByPrimaryKeys($this->transactionClockingsScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->transactionClockingsScheduledForDeletion = null;
             }
         }
         if ($this->collTransactionClockings !== null) {
             foreach ($this->collTransactionClockings as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }
 /**
  * Stores the object 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      Connection $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($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 coresponding set
         // method.  This object relates to these object(s) by a
         // foreign key reference.
         if ($this->aUserRelatedByCreatedUserId !== null) {
             if ($this->aUserRelatedByCreatedUserId->isModified()) {
                 $affectedRows += $this->aUserRelatedByCreatedUserId->save($con);
             }
             $this->setUserRelatedByCreatedUserId($this->aUserRelatedByCreatedUserId);
         }
         if ($this->aUserRelatedByUpdatedUserId !== null) {
             if ($this->aUserRelatedByUpdatedUserId->isModified()) {
                 $affectedRows += $this->aUserRelatedByUpdatedUserId->save($con);
             }
             $this->setUserRelatedByUpdatedUserId($this->aUserRelatedByUpdatedUserId);
         }
         if ($this->aSchema !== null) {
             if ($this->aSchema->isModified()) {
                 $affectedRows += $this->aSchema->save($con);
             }
             $this->setSchema($this->aSchema);
         }
         if ($this->aSchemaPropertyRelatedByIsSubpropertyOf !== null) {
             if ($this->aSchemaPropertyRelatedByIsSubpropertyOf->isModified()) {
                 $affectedRows += $this->aSchemaPropertyRelatedByIsSubpropertyOf->save($con);
             }
             $this->setSchemaPropertyRelatedByIsSubpropertyOf($this->aSchemaPropertyRelatedByIsSubpropertyOf);
         }
         if ($this->aStatus !== null) {
             if ($this->aStatus->isModified()) {
                 $affectedRows += $this->aStatus->save($con);
             }
             $this->setStatus($this->aStatus);
         }
         // If this object has been modified, then save it to the database.
         if ($this->isModified()) {
             if ($this->isNew()) {
                 $pk = SchemaPropertyPeer::doInsert($this, $con);
                 $affectedRows += 1;
                 // we are assuming that there is only 1 row per doInsert() which
                 // should always be true here (even though technically
                 // BasePeer::doInsert() can insert multiple rows).
                 $this->setId($pk);
                 //[IMV] update autoincrement primary key
                 $this->setNew(false);
             } else {
                 $affectedRows += SchemaPropertyPeer::doUpdate($this, $con);
             }
             $this->resetModified();
             // [HL] After being saved an object is no longer 'modified'
         }
         if ($this->collDiscusss !== null) {
             foreach ($this->collDiscusss as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->collSchemaPropertysRelatedByIsSubpropertyOf !== null) {
             foreach ($this->collSchemaPropertysRelatedByIsSubpropertyOf as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->collSchemaPropertyElementsRelatedBySchemaPropertyId !== null) {
             foreach ($this->collSchemaPropertyElementsRelatedBySchemaPropertyId as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->collSchemaPropertyElementsRelatedByRelatedSchemaPropertyId !== null) {
             foreach ($this->collSchemaPropertyElementsRelatedByRelatedSchemaPropertyId as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->collSchemaPropertyElementHistorysRelatedBySchemaPropertyId !== null) {
             foreach ($this->collSchemaPropertyElementHistorysRelatedBySchemaPropertyId as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->collSchemaPropertyElementHistorysRelatedByRelatedSchemaPropertyId !== null) {
             foreach ($this->collSchemaPropertyElementHistorysRelatedByRelatedSchemaPropertyId as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }
Example #16
0
 /**
  * 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 PropelPDO $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(PropelPDO $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 coresponding set
         // method.  This object relates to these object(s) by a
         // foreign key reference.
         if ($this->aUser !== null) {
             if ($this->aUser->isModified() || $this->aUser->isNew()) {
                 $affectedRows += $this->aUser->save($con);
             }
             $this->setUser($this->aUser);
         }
         if ($this->aOrganization !== null) {
             if ($this->aOrganization->isModified() || $this->aOrganization->isNew()) {
                 $affectedRows += $this->aOrganization->save($con);
             }
             $this->setOrganization($this->aOrganization);
         }
         if ($this->aChartRelatedByForkedFrom !== null) {
             if ($this->aChartRelatedByForkedFrom->isModified() || $this->aChartRelatedByForkedFrom->isNew()) {
                 $affectedRows += $this->aChartRelatedByForkedFrom->save($con);
             }
             $this->setChartRelatedByForkedFrom($this->aChartRelatedByForkedFrom);
         }
         if ($this->isNew() || $this->isModified()) {
             // persist changes
             if ($this->isNew()) {
                 $this->doInsert($con);
             } else {
                 $this->doUpdate($con);
             }
             $affectedRows += 1;
             $this->resetModified();
         }
         if ($this->chartsRelatedByIdScheduledForDeletion !== null) {
             if (!$this->chartsRelatedByIdScheduledForDeletion->isEmpty()) {
                 foreach ($this->chartsRelatedByIdScheduledForDeletion as $chartRelatedById) {
                     // need to save related object because we set the relation to null
                     $chartRelatedById->save($con);
                 }
                 $this->chartsRelatedByIdScheduledForDeletion = null;
             }
         }
         if ($this->collChartsRelatedById !== null) {
             foreach ($this->collChartsRelatedById as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->jobsScheduledForDeletion !== null) {
             if (!$this->jobsScheduledForDeletion->isEmpty()) {
                 JobQuery::create()->filterByPrimaryKeys($this->jobsScheduledForDeletion->getPrimaryKeys(false))->delete($con);
                 $this->jobsScheduledForDeletion = null;
             }
         }
         if ($this->collJobs !== null) {
             foreach ($this->collJobs as $referrerFK) {
                 if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }
Example #17
0
 /**
  * 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 PropelPDO $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(PropelPDO $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->aLanguage !== null) {
             if ($this->aLanguage->isModified() || $this->aLanguage->isNew()) {
                 $affectedRows += $this->aLanguage->save($con);
             }
             $this->setLanguage($this->aLanguage);
         }
         if ($this->aUserRelatedByOwnerId !== null) {
             if ($this->aUserRelatedByOwnerId->isModified() || $this->aUserRelatedByOwnerId->isNew()) {
                 $affectedRows += $this->aUserRelatedByOwnerId->save($con);
             }
             $this->setUserRelatedByOwnerId($this->aUserRelatedByOwnerId);
         }
         if ($this->aDocumentType !== null) {
             if ($this->aDocumentType->isModified() || $this->aDocumentType->isNew()) {
                 $affectedRows += $this->aDocumentType->save($con);
             }
             $this->setDocumentType($this->aDocumentType);
         }
         if ($this->aDocumentCategory !== null) {
             if ($this->aDocumentCategory->isModified() || $this->aDocumentCategory->isNew()) {
                 $affectedRows += $this->aDocumentCategory->save($con);
             }
             $this->setDocumentCategory($this->aDocumentCategory);
         }
         if ($this->aDocumentData !== null) {
             if ($this->aDocumentData->isModified() || $this->aDocumentData->isNew()) {
                 $affectedRows += $this->aDocumentData->save($con);
             }
             $this->setDocumentData($this->aDocumentData);
         }
         if ($this->aUserRelatedByCreatedBy !== null) {
             if ($this->aUserRelatedByCreatedBy->isModified() || $this->aUserRelatedByCreatedBy->isNew()) {
                 $affectedRows += $this->aUserRelatedByCreatedBy->save($con);
             }
             $this->setUserRelatedByCreatedBy($this->aUserRelatedByCreatedBy);
         }
         if ($this->aUserRelatedByUpdatedBy !== null) {
             if ($this->aUserRelatedByUpdatedBy->isModified() || $this->aUserRelatedByUpdatedBy->isNew()) {
                 $affectedRows += $this->aUserRelatedByUpdatedBy->save($con);
             }
             $this->setUserRelatedByUpdatedBy($this->aUserRelatedByUpdatedBy);
         }
         if ($this->isNew() || $this->isModified()) {
             // persist changes
             if ($this->isNew()) {
                 $this->doInsert($con);
             } else {
                 $this->doUpdate($con);
             }
             $affectedRows += 1;
             $this->resetModified();
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }