This might sound kind of basic (and it probably is) but I’ve been trying to get this for a few hours now and either I need a break from coding or it just wont budge.
I have an active record variable which brings database entries from a model:
$variable = Model::model()->findAll();
So I have $variable available in my view file and I want to check for the existance of a specific entry within the results. I am using the primary key of an entry available in the $variable but I can’t seem to get it working.
What is the correct way to check if a given entry is contained within that variable from the view file, not the controller?
PS: I do not want to iterate through the result set, it wouldn’t be very efficient for my application.
Thanks.