Esempio n. 1
0
 protected function doSave($con)
 {
     $affectedRows = 0;
     if (!$this->alreadyInSave) {
         $this->alreadyInSave = true;
         if ($this->aRegTestPeriod !== null) {
             if ($this->aRegTestPeriod->isModified()) {
                 $affectedRows += $this->aRegTestPeriod->save($con);
             }
             $this->setRegTestPeriod($this->aRegTestPeriod);
         }
         if ($this->aTestSubject !== null) {
             if ($this->aTestSubject->isModified()) {
                 $affectedRows += $this->aTestSubject->save($con);
             }
             $this->setTestSubject($this->aTestSubject);
         }
         if ($this->aLocation !== null) {
             if ($this->aLocation->isModified()) {
                 $affectedRows += $this->aLocation->save($con);
             }
             $this->setLocation($this->aLocation);
         }
         if ($this->isModified()) {
             if ($this->isNew()) {
                 $pk = TestSchedulePeer::doInsert($this, $con);
                 $affectedRows += 1;
                 $this->setId($pk);
                 $this->setNew(false);
             } else {
                 $affectedRows += TestSchedulePeer::doUpdate($this, $con);
             }
             $this->resetModified();
         }
         if ($this->collTestGrades !== null) {
             foreach ($this->collTestGrades as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->collTestApplScheds !== null) {
             foreach ($this->collTestApplScheds as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->collVTestApplScheds !== null) {
             foreach ($this->collVTestApplScheds as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->collVTestApplSched1s !== null) {
             foreach ($this->collVTestApplSched1s as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->collVTestApplSched2s !== null) {
             foreach ($this->collVTestApplSched2s as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->collVTestLocation1s !== null) {
             foreach ($this->collVTestLocation1s as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->collVTestLocation2s !== null) {
             foreach ($this->collVTestLocation2s as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }