コード例 #1
0
ファイル: AutocompleteManager.php プロジェクト: blab2015/seh
 /**
  * @param Department $department
  *
  * @return $this
  */
 public function removeDepartment($department)
 {
     $this->departmentType->deleteById($department->getId());
 }
コード例 #2
0
ファイル: DoctrineListener.php プロジェクト: blab2015/seh
 /**
  * @param City $city
  * @param Department $department
  */
 protected function removeCity($city, $department)
 {
     $departmentId = $department->getId();
     if (!isset($this->removeCities[$departmentId])) {
         $this->removeCities[$departmentId] = array();
     }
     $this->removeCities[$departmentId][] = $city->getId();
 }
コード例 #3
0
ファイル: HotelRepository.php プロジェクト: blab2015/seh
 /**
  * @param Department $department
  * @return array
  */
 public function findNbForDepartmentAndBrand($department, $brandId = null)
 {
     $departmentId = $department;
     if ($department instanceof Department) {
         $departmentId = $department->getId();
     }
     $qb = $this->getValidQueryBuilder()->leftJoin('ci.department', 'd')->andWhere('d.id = :department')->setParameter(':department', $departmentId)->select('COUNT(DISTINCT h.id) as nbHotels');
     if ($brandId != null) {
         $qb->andWhere('b.id = :idBrand')->setParameter(':idBrand', $brandId);
     }
     return $qb->getQuery()->getSingleScalarResult();
 }