PHP Class GDS\Schema

Author: Tom Walder ([email protected])
Mostra file Open project: tomwalder/php-gds Class Usage Examples

Public Methods

Method Description
__construct ( $str_kind ) Kind is required
addBoolean ( $str_name, boolean $bol_index = TRUE ) : Schema Add a boolean field to the schema
addDatetime ( $str_name, boolean $bol_index = TRUE ) : Schema Add a datetime field to the schema
addFloat ( $str_name, boolean $bol_index = TRUE ) : Schema Add a float|double field to the schema
addGeopoint ( $str_name, boolean $bol_index = TRUE ) : Schema Add a geopoint field to the schema
addInteger ( $str_name, boolean $bol_index = TRUE ) : Schema Add an integer field to the schema
addProperty ( $str_name, $int_type = self::PROPERTY_STRING, boolean $bol_index = TRUE ) Add a field to the known field array
addString ( $str_name, boolean $bol_index = TRUE ) : Schema Add a string field to the schema
addStringList ( $str_name, boolean $bol_index = TRUE ) : Schema Add a string-list (array of strings) field to the schema
createEntity ( ) : Entity Create a new instance of this GDS Entity class
getKind ( ) : string Get the Kind
getProperties ( ) : array Get the configured fields
setEntityClass ( $str_class ) Set the class to use when instantiating new Entity objects

Method Details

__construct() public method

Kind is required
public __construct ( $str_kind )
$str_kind

addBoolean() public method

Add a boolean field to the schema
public addBoolean ( $str_name, boolean $bol_index = TRUE ) : Schema
$str_name
$bol_index boolean
return Schema

addDatetime() public method

Add a datetime field to the schema
public addDatetime ( $str_name, boolean $bol_index = TRUE ) : Schema
$str_name
$bol_index boolean
return Schema

addFloat() public method

Add a float|double field to the schema
public addFloat ( $str_name, boolean $bol_index = TRUE ) : Schema
$str_name
$bol_index boolean
return Schema

addGeopoint() public method

Add a geopoint field to the schema
public addGeopoint ( $str_name, boolean $bol_index = TRUE ) : Schema
$str_name
$bol_index boolean
return Schema

addInteger() public method

Add an integer field to the schema
public addInteger ( $str_name, boolean $bol_index = TRUE ) : Schema
$str_name
$bol_index boolean
return Schema

addProperty() public method

Add a field to the known field array
public addProperty ( $str_name, $int_type = self::PROPERTY_STRING, boolean $bol_index = TRUE )
$str_name
$int_type
$bol_index boolean

addString() public method

Add a string field to the schema
public addString ( $str_name, boolean $bol_index = TRUE ) : Schema
$str_name
$bol_index boolean
return Schema

addStringList() public method

Add a string-list (array of strings) field to the schema
public addStringList ( $str_name, boolean $bol_index = TRUE ) : Schema
$str_name
$bol_index boolean
return Schema

createEntity() final public method

Create a new instance of this GDS Entity class
final public createEntity ( ) : Entity
return Entity

getKind() public method

Get the Kind
public getKind ( ) : string
return string

getProperties() public method

Get the configured fields
public getProperties ( ) : array
return array

setEntityClass() final public method

Must be GDS\Entity, or a sub-class of it
final public setEntityClass ( $str_class )
$str_class