コード例 #1
0
 protected function doSave($con)
 {
     $affectedRows = 0;
     if (!$this->alreadyInSave) {
         $this->alreadyInSave = true;
         if ($this->aProject !== null) {
             if ($this->aProject->isModified()) {
                 $affectedRows += $this->aProject->save($con);
             }
             $this->setProject($this->aProject);
         }
         if ($this->asfGuardUser !== null) {
             if ($this->asfGuardUser->isModified()) {
                 $affectedRows += $this->asfGuardUser->save($con);
             }
             $this->setsfGuardUser($this->asfGuardUser);
         }
         if ($this->aCampus !== null) {
             if ($this->aCampus->isModified()) {
                 $affectedRows += $this->aCampus->save($con);
             }
             $this->setCampus($this->aCampus);
         }
         if ($this->isModified()) {
             if ($this->isNew()) {
                 $pk = ProjectPositionPeer::doInsert($this, $con);
                 $affectedRows += 1;
                 $this->setId($pk);
                 $this->setNew(false);
             } else {
                 $affectedRows += ProjectPositionPeer::doUpdate($this, $con);
             }
             $this->resetModified();
         }
         if ($this->collPositionMilestones !== null) {
             foreach ($this->collPositionMilestones as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->collProjectUsers !== null) {
             foreach ($this->collProjectUsers as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->collCoFormApplications !== null) {
             foreach ($this->collCoFormApplications as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->collPositionApplications !== null) {
             foreach ($this->collPositionApplications as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }