/** * Add child * * @param \AppBundle\Entity\Bin $child * @return Bin */ public function addChild(Bin $child) { $this->children[] = $child; $child->setParent($this); return $this; }
public function findDeviationBin(Bin $bin) { return $this->getEntityManager()->createQueryBuilder()->select('b')->from('AppBundle:Bin', 'b')->join('b.department', 'd')->where('b.name LIKE :deviation_name')->andWhere('d.office = :office')->setParameter('deviation_name', '%Deviation')->setParameter('office', $bin->getDepartment()->getOffice())->getQuery()->getOneOrNullResult(); }