PHP Class GDS\Mapper\ProtoBufGQLParser

Author: Tom Walder ([email protected])
显示文件 Open project: tomwalder/php-gds Class Usage Examples

Protected Properties

Property Type Description
$obj_schema GDS\Schema | null This is optional, because Google Datastore is schemaless.

Public Methods

Method Description
__construct ( Schema $obj_schema = null ) Optionally, reference to the Entity schema to check type validity
getEndCursor ( ) : string Get any end cursor
getFilters ( ) : array Get any filters
getKind ( ) : string Get the query Kind
getLimit ( ) : integer Get the query limit
getOffset ( ) : integer Get the offset
getOrderBy ( ) : array Get any order bys
getStartCursor ( ) : string Get any start cursor
parse ( $str_gql, google\appengine\datastore\v4\GqlQueryArg[] $arr_named_params = [] ) Turn a GQL string and parameter array into a "lookup" query

Private Methods

Method Description
getIntStringFromValue ( $mix_val ) : array Extract a string/int tuple from the value. Used for offsets and limits which can be string cursors or integers
lookupToken ( $str_val ) : mixed Lookup the field in our token & named parameter list
recordKind ( $arr ) : string Record the Kind
recordLimit ( $arr ) : string Record the limit
recordOffset ( $arr ) : string Record the offset
recordOrder ( $arr ) : string Process the ORDER BY clause
recordWhere ( $arr ) : string Process the WHERE clause
tokenizeQuoted ( $arr ) : string Record quoted strings, return simple tokens

Method Details

__construct() public method

Optionally, reference to the Entity schema to check type validity
public __construct ( Schema $obj_schema = null )
$obj_schema GDS\Schema

getEndCursor() public method

Get any end cursor
public getEndCursor ( ) : string
return string

getFilters() public method

Get any filters
public getFilters ( ) : array
return array

getKind() public method

Get the query Kind
public getKind ( ) : string
return string

getLimit() public method

Get the query limit
public getLimit ( ) : integer
return integer

getOffset() public method

Get the offset
public getOffset ( ) : integer
return integer

getOrderBy() public method

Get any order bys
public getOrderBy ( ) : array
return array

getStartCursor() public method

Get any start cursor
public getStartCursor ( ) : string
return string

parse() public method

We use preg_replace_callback to "prune" down the GQL string so we are left with nothing
public parse ( $str_gql, google\appengine\datastore\v4\GqlQueryArg[] $arr_named_params = [] )
$str_gql
$arr_named_params google\appengine\datastore\v4\GqlQueryArg[]

Property Details

$obj_schema protected_oe property

This is optional, because Google Datastore is schemaless.
protected Schema,GDS|null $obj_schema
return GDS\Schema | null