I have a Doctrine model with the date field “date_of_birth” (symfony form date) that is filled by the user, everything works 100%, it saves db as expected, however, in the save () method of the model I need to get the value of this field before saving. My problem is that when I try to get the date value, it returns an empty string if its a new record and old value if it is an existing record
public function save(Doctrine_Connection $conn = null) { $dob = $this->getDateOfBirth(); // returns empty str if new and old value if existing $dob = $this->date_of_birth; //also returns empty str return parent::save($conn); }
How can I get the value of this field, data is saved
save symfony1 doctrine
wikus verreynne
source share