public function save(Doctrine_Connection $conn = null) { if ($this->isNew() && !$this->getStudentUid()) { $this->setStudentUid($this->getGeneratedIdNumber()); } parent::save($conn); AutoincrementTable::updateAutoincrement($this->getId(), 'Student'); }