protected function doSave($con) { $affectedRows = 0; if (!$this->alreadyInSave) { $this->alreadyInSave = true; if ($this->aWebImageCategory !== null) { if ($this->aWebImageCategory->isModified()) { $affectedRows += $this->aWebImageCategory->save($con); } $this->setWebImageCategory($this->aWebImageCategory); } if ($this->isModified()) { if ($this->isNew()) { $pk = WebImagePeer::doInsert($this, $con); $affectedRows += 1; $this->setId($pk); $this->setNew(false); } else { $affectedRows += WebImagePeer::doUpdate($this, $con); } $this->resetModified(); } $this->alreadyInSave = false; } return $affectedRows; }