CakePHP - How to check in beforeSave if it's an INSERT or UPDATE
You can just check in the data if the id
exists:
function beforeSave($options = array())
{
if(empty($this->data[$this->alias]['id']))
{
//INSERT
}
else
{
//UPDATE
}
}