symfony class::preInsert() should be compatible with that of Doctrine_Record::preInsert()
I wanted to use the preInsert() method to do some calculations on a model class before it was saved. But I encountered the error:
Strict Standards: Declaration of Blah::preInsert() should be compatible with that of Doctrine_Record::preInsert() in /PATH/lib/model/doctrine/Klass.class.php on line 14
The code I had in my class file looked something like this:
public function preInsert(Doctrine_Event $event)
{
$this->calculate_status();
}
This seemed correct, but I was getting this strict error.
Anyway, short story shorter, I removed the Doctrine_Event (type hint?) from my method signature and the warning went away.
New code looks like this:
public function preInsert($event)
{
$this->calculate_status();
}