/** * @param Brand $brand * @return array */ public function findAllWithHotelsForBrand($brand = null) { $queryBuilder = $this->createQueryBuilder('r')->select('r')->distinct()->join('r.hotels', 'h'); if ($brand && $brand->getArtsysID() != 'SEH') { $queryBuilder->andWhere('h.brand = :brand')->setParameter(':brand', $brand); } return $queryBuilder->andWhere('h.active = :active')->andWhere('h.adherent = :adherent')->setParameter(':active', true)->setParameter(':adherent', true)->getQuery()->getResult(); }
/** * Add brand * * @param \Seh\Bundle\SehBundle\Entity\Brand $brand * @return $this */ public function addBrand($brand) { $brand->addFaqQuestion($this); $this->brands->add($brand); return $this; }
/** * @param ImportedBrand $source * @param Brand $destination * @return mixed */ public function map($source, $destination) { $destination->setArtsysID($source->getCode()); $destination->setName($source->getName()); return $destination; }
/** * Get brand * * @return string */ public function getBrandName() { return $this->brand->getName(); }
/** * @param Brand $brand * @return $this */ public function setBrand(\Seh\Bundle\SehBundle\Entity\Brand $brand = null) { $this->brand = $brand; $brand->addHotel($this); return $this; }
/** * Removes a brand. * * @param Brand $brand * @return $this For fluid purposes. */ public function removeBrand(\Seh\Bundle\SehBundle\Entity\Brand $brand) { $this->brands->removeElement($brand); return $this; }