I am using Cakephp 1.3
As i have multiple controllers
like , Score, Stundets etc..
in score i have multiple functions with differents conditions
Now what i need i want to add some logic in before filter function that to show only field is_deleted =0
I am trying this code
$this->Score->Student->conditions='Student.is_deleted=>0';
As passing all conditions too all function is too time Consuming
This above code is not working. I want to add filter So i will work in whole project
Anybody have an idea
Thanks
You should use beforeFind() method in your
Studentmodel instead of putting your conditions logic inbeforeFilter()method.Write this code into
Student Model:This post might also help you to achieve the same.
You can also use Behavior Callbacks.
Hope it will work for you.