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