public function hasHc(\dlaser\HcBundle\Entity\Hc $hc) { foreach ($this->hc as $value) { if ($value->getId() == $hc->getId()) { return true; } } return false; }