<?php

/**
 * Created by PhpStorm.
 * User: alex
 * Date: 18/02/16
 * Time: 12:00
 */

namespace AppBundle\Entity\Booking\Repository;

use Doctrine\ORM\EntityRepository;
use Recurr\DateExclusion;
use Recurr\Rule;
use Recurr\Transformer\ArrayTransformer;
use Recurr\Transformer\Constraint\BetweenConstraint;
use Doctrine\ORM\Tools\Pagination\Paginator;
use Dunglas\ApiBundle\Api\ResourceInterface;
use Symfony\Component\HttpFoundation\Request;

class CalendarSynchroRepository extends EntityRepository {

    public function findByIdAndHash($calendarsynchro_id, $hash){


        $qb = $this->createQueryBuilder('a');

        $qb
            ->where('a.id = :id')
            ->andWhere('a.hash = :hash')
            ->setParameter('id', $calendarsynchro_id)
            ->setParameter('hash', $hash);

        return $qb->getQuery()->getOneOrNullResult();
    }
}
