protected function doSave($con) { $affectedRows = 0; if (!$this->alreadyInSave) { $this->alreadyInSave = true; if ($this->asfSimpleCMSPageRelatedByTreeParent !== null) { if ($this->asfSimpleCMSPageRelatedByTreeParent->isModified()) { $affectedRows += $this->asfSimpleCMSPageRelatedByTreeParent->save($con); } $this->setsfSimpleCMSPageRelatedByTreeParent($this->asfSimpleCMSPageRelatedByTreeParent); } if ($this->isModified()) { if ($this->isNew()) { $pk = sfSimpleCMSPagePeer::doInsert($this, $con); $affectedRows += 1; $this->setId($pk); $this->setNew(false); } else { $affectedRows += sfSimpleCMSPagePeer::doUpdate($this, $con); } $this->resetModified(); } if ($this->collsfSimpleCMSPagesRelatedByTreeParent !== null) { foreach ($this->collsfSimpleCMSPagesRelatedByTreeParent as $referrerFK) { if (!$referrerFK->isDeleted()) { $affectedRows += $referrerFK->save($con); } } } if ($this->collsfSimpleCMSSlots !== null) { foreach ($this->collsfSimpleCMSSlots as $referrerFK) { if (!$referrerFK->isDeleted()) { $affectedRows += $referrerFK->save($con); } } } $this->alreadyInSave = false; } return $affectedRows; }