We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Find() with afterFetch() problem

in model I have

public function afterFetch()
  {
       if($this->type == 'type1')
          { die('333');  }
    }

in controller I have

$feeds = Feed::find("type = 'type1'");
 foreach($feeds as $feed){
            die('111');
        }

I get 333 output, what's going on?



58.4k

Hey

It will allway running into the if statenment. Becuse you find data via condition type1, you can take look discussion at https://forum.phalcon.io/discussion/498/afterfetch-