public function getScopedQuery($entity)
    {
        $query = $this->getRepository()->getQuery();

        foreach ($this->_scopes as $key => $value) {
            if (is_numeric($key)) {
                $key = $value;
                $value = $entity->$key;
            }

            $query->where($key, '=', $value);
        }

        return $query;
    }
public function getScopedQuery($entity)
    {
        $query = $this->getRepository()->getQuery();

        foreach ($this->_scopes as $key => $value) {
            if (is_numeric($key)) {
                $key = $value;
                $value = $entity->$key;
            }

            $query->where($key, '=', $value);
        }

        return $query;
    }
public function getScopedQuery ( $ entity ) { $ query = $ this -> getRepository ( ) -> getQuery ( ) ; foreach ( $ this -> _scopes as $ key => $ value ) { if ( is_numeric ( $ key ) ) { $ key = $ value ; $ value = $ entity -> $ key ; } $ query -> where ( $ key , '=' , $ value ) ; } return $ query ; }
Return the query after applying the scope.

@param AnDomainEntityAbstract $entity The  entity

@return AnDomainQuery
Return the query after applying the scope .