createQueryBuilder('tp') ->innerJoin('tp.page', 'page') ->addSelect('page') ->leftJoin('tp.countries', 'country') ->addSelect('country') ->leftJoin('country.destinations', 'destination') ->addSelect('destination') ->leftJoin('tp.options', 'option') ->addSelect('option') ->leftJoin('tp.images', 'image', Expr\Join::WITH, 'image.type = 1') ->addSelect('image') ->where('tp.status = 1') ->andWhere('tp.programType = '. TravelProgram::ORGANIZED_PROGRAM_TYPE) ->getQuery() ->execute() ; } }