protected function instantiateQuery($queryClass, $apiQueryName)
    {
        if (!is_a($queryClass, static::$queryInterface, true))
        {
            throw new RuntimeException("Query class '{$queryClass}' does not implements '" .
                                       static::$queryInterface . "' interface.");
        }

        return new $queryClass($apiQueryName);
    }
protected function instantiateQuery($queryClass, $apiQueryName)
    {
        if (!is_a($queryClass, static::$queryInterface, true))
        {
            throw new RuntimeException("Query class '{$queryClass}' does not implements '" .
                                       static::$queryInterface . "' interface.");
        }

        return new $queryClass($apiQueryName);
    }
protected function instantiateQuery ( $ queryClass , $ apiQueryName ) { if ( ! is_a ( $ queryClass , static :: $ queryInterface , true ) ) { throw new RuntimeException ( "Query class '{$queryClass}' does not implements '" . static :: $ queryInterface . "' interface." ) ; } return new $ queryClass ( $ apiQueryName ) ; }
Method check query class and return new query object

@param       string      $queryClass         Query class
@param       string      $apiQueryName       Query api method name

@return      QueryInterface                  New query object

@throws      RuntimeException                Query does not implements QueryInterface
Method check query class and return new query object