public function filter(QueryBuilder $queryBuilder, $options = array())
    {
        if ( ! $options instanceof DateTime) {
            throw new InvalidArgumentException(
                '$options is expected to be an instance of DateTime'
            );
        }
        $aliases = $queryBuilder->getRootAliases();
        $queryBuilder->andWhere(sprintf(
            '%s.%s %s :%s',
            $aliases[0],
            $this->getPropertyName(),
            $this->getComparison(),
            $this->getName()
        ));
        $queryBuilder->setParameter(
            $this->getName(),
            $options->format('Y-m-d H:i:s')
        );
    }
public function filter(QueryBuilder $queryBuilder, $options = array())
    {
        if ( ! $options instanceof DateTime) {
            throw new InvalidArgumentException(
                '$options is expected to be an instance of DateTime'
            );
        }
        $aliases = $queryBuilder->getRootAliases();
        $queryBuilder->andWhere(sprintf(
            '%s.%s %s :%s',
            $aliases[0],
            $this->getPropertyName(),
            $this->getComparison(),
            $this->getName()
        ));
        $queryBuilder->setParameter(
            $this->getName(),
            $options->format('Y-m-d H:i:s')
        );
    }
public function filter ( QueryBuilder $ queryBuilder , $ options = array ( ) ) { if ( ! $ options instanceof DateTime ) { throw new InvalidArgumentException ( '$options is expected to be an instance of DateTime' ) ; } $ aliases = $ queryBuilder -> getRootAliases ( ) ; $ queryBuilder -> andWhere ( sprintf ( '%s.%s %s :%s' , $ aliases [ 0 ] , $ this -> getPropertyName ( ) , $ this -> getComparison ( ) , $ this -> getName ( ) ) ) ; $ queryBuilder -> setParameter ( $ this -> getName ( ) , $ options -> format ( 'Y-m-d H:i:s' ) ) ; }
Generic DateTime filter

@param QueryBuilder $queryBuilder
@param DateTime $options
@throws InvalidArgumentException if $options is not an instance of DateTime
Generic DateTime filter