I have registered users in my application, when a user wants to unsubscribe or is locked in the database is marked as Locked
ArrayCollection all need to be changed or do I have to make a new function for each ArrayCollection?
for Example:
this is arrayCollection
/**
* Get like
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getLike()
{
return $this->like;
}
When I user is locked i have to create a new function like:
/**
* Get like2
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getLike2()
{
//USE CRITERIA OR
$out = array();
foreach ($this->like as $like2) {
if (!getUser()->getLocked()) {
$out[] = $like2;
}
}
}
Or I can use the "default" ArrayCollection with some modifications