Monday, May 7, 2012

How to check if Entity is in an array collection of another Entity

 Check if $friend is in the friends array collection of the user
$user->getFriends()->contains($friend); 

if $friend is in the array collection  method returns true otherwise it returns false

No comments:

Post a Comment