I have a model wich checks a lot of things in beforeSave callback. I do not want to use cakephp validation system for that purpose because it is more simple for me in this case.
If the checking chain fails in somewhere I return false and no saving happens, It is the normal work. I want to give back informal error messages in the entity to use it in the controller and/or view.
How I can do that? Example:
public function beforeSave($event, $entity, $options)
{
if($entity->isNew())
{
if(fail1) $entity->inserterrormessage('XYZ is missing');
if(fail2) $entity->inserterrormessage('Please check if...');
}
}