Esempio n. 1
0
 protected function doSave($con)
 {
     $affectedRows = 0;
     if (!$this->alreadyInSave) {
         $this->alreadyInSave = true;
         if ($this->anahoWikiWiki !== null) {
             if ($this->anahoWikiWiki->isModified()) {
                 $affectedRows += $this->anahoWikiWiki->save($con);
             }
             $this->setnahoWikiWiki($this->anahoWikiWiki);
         }
         if ($this->isModified()) {
             if ($this->isNew()) {
                 $pk = nahoWikiPagePeer::doInsert($this, $con);
                 $affectedRows += 1;
                 $this->setId($pk);
                 $this->setNew(false);
             } else {
                 $affectedRows += nahoWikiPagePeer::doUpdate($this, $con);
             }
             $this->resetModified();
         }
         if ($this->collnahoWikiRevisions !== null) {
             foreach ($this->collnahoWikiRevisions as $referrerFK) {
                 if (!$referrerFK->isDeleted()) {
                     $affectedRows += $referrerFK->save($con);
                 }
             }
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }