Example #1
0
 /**
  * @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();
 }
Example #2
0
 /**
  * Add brand
  *
  * @param \Seh\Bundle\SehBundle\Entity\Brand $brand
  * @return $this
  */
 public function addBrand($brand)
 {
     $brand->addFaqQuestion($this);
     $this->brands->add($brand);
     return $this;
 }
Example #3
0
 /**
  * @param ImportedBrand $source
  * @param Brand $destination
  * @return mixed
  */
 public function map($source, $destination)
 {
     $destination->setArtsysID($source->getCode());
     $destination->setName($source->getName());
     return $destination;
 }
Example #4
0
 /**
  * Get brand
  *
  * @return string
  */
 public function getBrandName()
 {
     return $this->brand->getName();
 }
Example #5
0
 /**
  * @param Brand $brand
  * @return $this
  */
 public function setBrand(\Seh\Bundle\SehBundle\Entity\Brand $brand = null)
 {
     $this->brand = $brand;
     $brand->addHotel($this);
     return $this;
 }
Example #6
0
 /**
  * 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;
 }