My code throws an exeption "PhalconException: The method 'findFirstByTitle' doesn't exist on model 'Plant'"
How can I fix it? Code:
class Plant extends \Phalcon\Mvc\Model {
public $id;
public $title;
protected function beforeSave() {
if(empty($this->id) && $plant = self::findFirstByTitle($this->title)) {
$this->id = $plant->id;
return false;
}
}
}
P.S.: I also tried to use $this-> instead of self:: with no success. PHP version: 5.4.43 Phalcon version: 2.0.6
Thanks.