I use the beforeFind() callback with some conditions that must be apply in most case, but not in all. And the quesion is about this.
What are the right way for disable the beforeFind() callback?
At the moment i use this approach:
in beforeFind() i have a return $query if options default are false
if(isset($options['default']) && $options['default'] == false){
return $query;
}
And now when i perform a find() operation, i can disable by set default option to false
$this->Articles->find()->applyOptions(['default' => false])...
But when i use get() method, i don't know how to do...
i can use findById() and applyOptions again but if there are another way i prefer.
Thanks in advance!