Ejemplo n.º 1
0
 protected function doSave($con)
 {
     $affectedRows = 0;
     if (!$this->alreadyInSave) {
         $this->alreadyInSave = true;
         if ($this->aCatalog !== null) {
             if ($this->aCatalog->isModified()) {
                 $affectedRows += $this->aCatalog->save($con);
             }
             $this->setCatalog($this->aCatalog);
         }
         if ($this->aDepartment !== null) {
             if ($this->aDepartment->isModified()) {
                 $affectedRows += $this->aDepartment->save($con);
             }
             $this->setDepartment($this->aDepartment);
         }
         if ($this->aCatCategory !== null) {
             if ($this->aCatCategory->isModified()) {
                 $affectedRows += $this->aCatCategory->save($con);
             }
             $this->setCatCategory($this->aCatCategory);
         }
         if ($this->aColStatus !== null) {
             if ($this->aColStatus->isModified()) {
                 $affectedRows += $this->aColStatus->save($con);
             }
             $this->setColStatus($this->aColStatus);
         }
         if ($this->aColLocation !== null) {
             if ($this->aColLocation->isModified()) {
                 $affectedRows += $this->aColLocation->save($con);
             }
             $this->setColLocation($this->aColLocation);
         }
         if ($this->isModified()) {
             if ($this->isNew()) {
                 $pk = VOpacPeer::doInsert($this, $con);
                 $affectedRows += 1;
                 $this->setNew(false);
             } else {
                 $affectedRows += VOpacPeer::doUpdate($this, $con);
             }
             $this->resetModified();
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }