This has got to be a newbie question. I have searched, but can't
seem to find an answer.
Is there a way to get an error code for why the delete or
beforeDelete failed and have this passed back to the Controller
instead of just false?
using the example from the documentation
function beforeDelete()
{
$count
= $this->Product->find("count", array(
"conditions" =>
array("product_category_id" => $this->id)
));
if ($count == 0) {
return true;
} else {
return false;
}
}
in this example if there are products left in the category
($count >0) it will return false. But how does the controller
know that this was reason? What if before delete checked for
products AND subcategories? The controller/view would want to
send a message to user as to why the delete failed.
What am I missing?
Thanks,
bill
--
View this message in context:
http://cakephp.1045679.n5.nabble.com/error-code-from-delete-or-beforeDelete-tp5708340.html
Sent from the CakePHP mailing list archive at Nabble.com.
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others
with their CakePHP related questions.
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php