Esempio n. 1
0
 protected function doSave($con)
 {
     $affectedRows = 0;
     if (!$this->alreadyInSave) {
         $this->alreadyInSave = true;
         if ($this->aAcademicCost !== null) {
             if ($this->aAcademicCost->isModified()) {
                 $affectedRows += $this->aAcademicCost->save($con);
             }
             $this->setAcademicCost($this->aAcademicCost);
         }
         if ($this->aJob !== null) {
             if ($this->aJob->isModified() || $this->aJob->getCurrentJobI18n()->isModified()) {
                 $affectedRows += $this->aJob->save($con);
             }
             $this->setJob($this->aJob);
         }
         if ($this->aAcademicProcess !== null) {
             if ($this->aAcademicProcess->isModified()) {
                 $affectedRows += $this->aAcademicProcess->save($con);
             }
             $this->setAcademicProcess($this->aAcademicProcess);
         }
         if ($this->aPaymentModel !== null) {
             if ($this->aPaymentModel->isModified()) {
                 $affectedRows += $this->aPaymentModel->save($con);
             }
             $this->setPaymentModel($this->aPaymentModel);
         }
         if ($this->aTransactionStatus !== null) {
             if ($this->aTransactionStatus->isModified()) {
                 $affectedRows += $this->aTransactionStatus->save($con);
             }
             $this->setTransactionStatus($this->aTransactionStatus);
         }
         if ($this->isModified()) {
             if ($this->isNew()) {
                 $pk = PaymentJournalPeer::doInsert($this, $con);
                 $affectedRows += 1;
                 $this->setId($pk);
                 $this->setNew(false);
             } else {
                 $affectedRows += PaymentJournalPeer::doUpdate($this, $con);
             }
             $this->resetModified();
         }
         if ($this->collPaymentPayers !== null) {
             foreach ($this->collPaymentPayers as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->collPaymentHistorys !== null) {
             foreach ($this->collPaymentHistorys as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }