protected function resolveHandler(Query $query)
    {
        if ($query instanceof ReadQuery) {
            return new ReadQueryHandler($this);
        }

        if ($query instanceof InsertQuery) {
            return new InsertQueryHandler($this);
        }

        if ($query instanceof DeleteQuery) {
            return new DeleteQueryHandler($this);
        }

        if ($query instanceof UpdateQuery) {
            return new UpdateQueryHandler($this);
        }

        throw new Exception('Could not resolve handler for query');
    }
protected function resolveHandler(Query $query)
    {
        if ($query instanceof ReadQuery) {
            return new ReadQueryHandler($this);
        }

        if ($query instanceof InsertQuery) {
            return new InsertQueryHandler($this);
        }

        if ($query instanceof DeleteQuery) {
            return new DeleteQueryHandler($this);
        }

        if ($query instanceof UpdateQuery) {
            return new UpdateQueryHandler($this);
        }

        throw new Exception('Could not resolve handler for query');
    }
protected function resolveHandler ( Query $ query ) { if ( $ query instanceof ReadQuery ) { return new ReadQueryHandler ( $ this ) ; } if ( $ query instanceof InsertQuery ) { return new InsertQueryHandler ( $ this ) ; } if ( $ query instanceof DeleteQuery ) { return new DeleteQueryHandler ( $ this ) ; } if ( $ query instanceof UpdateQuery ) { return new UpdateQueryHandler ( $ this ) ; } throw new Exception ( 'Could not resolve handler for query' ) ; }
Find the appropriate handler for a given Query

@param Query $query
@return DeleteQueryHandler|InsertQueryHandler|ReadQueryHandler
@throws \Exception
Find the appropriate handler for a given Query