Пример #1
0
 protected function doSave($con)
 {
     $affectedRows = 0;
     if (!$this->alreadyInSave) {
         $this->alreadyInSave = true;
         if ($this->asfGuardUserRelatedByCreatedBy !== null) {
             if ($this->asfGuardUserRelatedByCreatedBy->isModified()) {
                 $affectedRows += $this->asfGuardUserRelatedByCreatedBy->save($con);
             }
             $this->setsfGuardUserRelatedByCreatedBy($this->asfGuardUserRelatedByCreatedBy);
         }
         if ($this->asfGuardUserRelatedByOwnerId !== null) {
             if ($this->asfGuardUserRelatedByOwnerId->isModified()) {
                 $affectedRows += $this->asfGuardUserRelatedByOwnerId->save($con);
             }
             $this->setsfGuardUserRelatedByOwnerId($this->asfGuardUserRelatedByOwnerId);
         }
         if ($this->aDepartment !== null) {
             if ($this->aDepartment->isModified()) {
                 $affectedRows += $this->aDepartment->save($con);
             }
             $this->setDepartment($this->aDepartment);
         }
         if ($this->aCampus !== null) {
             if ($this->aCampus->isModified()) {
                 $affectedRows += $this->aCampus->save($con);
             }
             $this->setCampus($this->aCampus);
         }
         if ($this->isModified()) {
             if ($this->isNew()) {
                 $pk = ProjectApplicationPeer::doInsert($this, $con);
                 $affectedRows += 1;
                 $this->setId($pk);
                 $this->setNew(false);
             } else {
                 $affectedRows += ProjectApplicationPeer::doUpdate($this, $con);
             }
             $this->resetModified();
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }