PHP 클래스 GDS\Store

MUST be for a specific Entity Kind (as defined by the Schema or Kind passed in on construction)
저자: Tom Walder ([email protected])
파일 보기 프로젝트 열기: tomwalder/php-gds 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( Schema | string | null $kind_schema = null, Gateway $obj_gateway = null ) Gateway and Schema/Kind can be supplied on construction
beginTransaction ( boolean $bol_cross_group = FALSE ) Begin a transaction
createEntity ( array | null $arr_data = null ) : Entity Create a new instance of this GDS Entity class
delete ( $entities ) : boolean Delete one or more Model objects from the Datastore
fetchAll ( $str_query = null, array | null $arr_params = null ) : Entity[] Fetch Entities (optionally based on a GQL query)
fetchById ( $str_id ) : Entity | null Fetch a single Entity from the Datastore, by it's Key ID
fetchByIds ( array $arr_ids ) : Entity[] Fetch multiple entities by Key ID
fetchByName ( $str_name ) : Entity | null Fetch a single Entity from the Datastore, by it's Key Name
fetchByNames ( array $arr_names ) : Entity | null Fetch one or more Entities from the Datastore, by their Key Name
fetchEntityGroup ( Entity $obj_entity ) : Entity[] Fetch all of the entities in a particular group
fetchOne ( $str_query = null, array | null $arr_params = null ) : Entity Fetch ONE Entity based on a GQL query
fetchPage ( $int_page_size, null $mix_offset = null ) : Entity[] Fetch (a page of) Entities (optionally based on a GQL query)
getCursor ( ) : null | string Get the last result cursor
query ( $str_query, array | null $arr_params = null ) Fetch Entities based on a GQL query
setCursor ( $str_cursor ) Set the query cursor
setEntityClass ( $str_class ) Set the class to use when instantiating new Entity objects
upsert ( $entities ) Write one or more new/changed Entity objects to the Datastore

보호된 메소드들

메소드 설명
buildSchema ( ) : Schema | null Optionally build and return a Schema object describing the data model

비공개 메소드들

메소드 설명
consumeTransaction ( ) : string | null Clear and return the current transaction ID
determineSchema ( Schema | string | null $mix_schema ) : Schema Set up the Schema for the current data model, based on the provided Kind/Schema/buildSchema

메소드 상세

__construct() 공개 메소드

Gateway and Schema/Kind can be supplied on construction
public __construct ( Schema | string | null $kind_schema = null, Gateway $obj_gateway = null )
$kind_schema Schema | string | null
$obj_gateway Gateway

beginTransaction() 공개 메소드

Begin a transaction
public beginTransaction ( boolean $bol_cross_group = FALSE )
$bol_cross_group boolean

buildSchema() 보호된 메소드

This method is intended to be overridden in any extended Store classes
protected buildSchema ( ) : Schema | null
리턴 Schema | null

createEntity() 최종 공개 메소드

Create a new instance of this GDS Entity class
final public createEntity ( array | null $arr_data = null ) : Entity
$arr_data array | null
리턴 Entity

delete() 공개 메소드

Delete one or more Model objects from the Datastore
public delete ( $entities ) : boolean
리턴 boolean

fetchAll() 공개 메소드

Fetch Entities (optionally based on a GQL query)
public fetchAll ( $str_query = null, array | null $arr_params = null ) : Entity[]
$str_query
$arr_params array | null
리턴 Entity[]

fetchById() 공개 메소드

Only works for root Entities (i.e. those without parent Entities)
public fetchById ( $str_id ) : Entity | null
$str_id
리턴 Entity | null

fetchByIds() 공개 메소드

Fetch multiple entities by Key ID
public fetchByIds ( array $arr_ids ) : Entity[]
$arr_ids array
리턴 Entity[]

fetchByName() 공개 메소드

Only works for root Entities (i.e. those without parent Entities)
public fetchByName ( $str_name ) : Entity | null
$str_name
리턴 Entity | null

fetchByNames() 공개 메소드

Only works for root Entities (i.e. those without parent Entities)
public fetchByNames ( array $arr_names ) : Entity | null
$arr_names array
리턴 Entity | null

fetchEntityGroup() 공개 메소드

Fetch all of the entities in a particular group
public fetchEntityGroup ( Entity $obj_entity ) : Entity[]
$obj_entity Entity
리턴 Entity[]

fetchOne() 공개 메소드

Fetch ONE Entity based on a GQL query
public fetchOne ( $str_query = null, array | null $arr_params = null ) : Entity
$str_query
$arr_params array | null
리턴 Entity

fetchPage() 공개 메소드

Fetch (a page of) Entities (optionally based on a GQL query)
public fetchPage ( $int_page_size, null $mix_offset = null ) : Entity[]
$int_page_size
$mix_offset null
리턴 Entity[]

getCursor() 공개 메소드

Get the last result cursor
public getCursor ( ) : null | string
리턴 null | string

query() 공개 메소드

Supported parameter types: String, Integer, DateTime, GDS\Entity
public query ( $str_query, array | null $arr_params = null )
$str_query
$arr_params array | null

setCursor() 공개 메소드

Usually before continuing through a paged result set
public setCursor ( $str_cursor )
$str_cursor

setEntityClass() 공개 메소드

Must be GDS\Entity, or a sub-class of it This method is here to maintain backwards compatibility. The Schema is responsible in 2.0+
public setEntityClass ( $str_class )
$str_class

upsert() 공개 메소드

Write one or more new/changed Entity objects to the Datastore
public upsert ( $entities )