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