protected function doSave($con) { $affectedRows = 0; if (!$this->alreadyInSave) { $this->alreadyInSave = true; if ($this->aVClassGroupRelatedByParent !== null) { if ($this->aVClassGroupRelatedByParent->isModified()) { $affectedRows += $this->aVClassGroupRelatedByParent->save($con); } $this->setVClassGroupRelatedByParent($this->aVClassGroupRelatedByParent); } if ($this->aDepartment !== null) { if ($this->aDepartment->isModified()) { $affectedRows += $this->aDepartment->save($con); } $this->setDepartment($this->aDepartment); } if ($this->isModified()) { if ($this->isNew()) { $pk = VClassGroupPeer::doInsert($this, $con); $affectedRows += 1; $this->setId($pk); $this->setNew(false); } else { $affectedRows += VClassGroupPeer::doUpdate($this, $con); } $this->resetModified(); } if ($this->collVClassGroupsRelatedByParent !== null) { foreach ($this->collVClassGroupsRelatedByParent as $referrerFK) { if (!$referrerFK->isDeleted()) { $affectedRows += $referrerFK->save($con); } } } $this->alreadyInSave = false; } return $affectedRows; }