Ejemplo n.º 1
0
 protected function doSave($con)
 {
     $affectedRows = 0;
     if (!$this->alreadyInSave) {
         $this->alreadyInSave = true;
         if ($this->aCatTemplate !== null) {
             if ($this->aCatTemplate->isModified()) {
                 $affectedRows += $this->aCatTemplate->save($con);
             }
             $this->setCatTemplate($this->aCatTemplate);
         }
         if ($this->isModified()) {
             if ($this->isNew()) {
                 $pk = CatCategoryPeer::doInsert($this, $con);
                 $affectedRows += 1;
                 $this->setId($pk);
                 $this->setNew(false);
             } else {
                 $affectedRows += CatCategoryPeer::doUpdate($this, $con);
             }
             $this->resetModified();
         }
         if ($this->collCatalogs !== null) {
             foreach ($this->collCatalogs as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         if ($this->collCirRegulations !== null) {
             foreach ($this->collCirRegulations as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }