Parse PHP SDK API Reference

ParseSchema
in package

Class ParseSchema - Handles schemas data from Parse.

All the schemas methods need use of the master key for your application.

Tags
see
http://docs.parseplatform.org/rest/guide/#schema
author

Júlio César Gonçalves de Oliveira [email protected]

Table of Contents

$ARRAY  : string
Array data type
$BOOLEAN  : string
Boolean data type
$DATE  : string
Date data type
$FILE  : string
File data type
$GEO_POINT  : string
GeoPoint data type
$NUMBER  : string
Number data type
$OBJECT  : string
Object data type
$POINTER  : string
Pointer data type
$POLYGON  : string
Polygon data type
$RELATION  : string
Relation data type
$STRING  : string
String data type
$className  : string
Class name for data stored on Parse.
$fields  : array<string|int, mixed>
Fields to create.
$indexes  : array<string|int, mixed>
Indexes to create.
$useMasterKey  : bool
Force to use master key in Schema Methods.
__construct()  : mixed
Create a Parse Schema.
addArray()  : ParseSchema
Adding Array Field.
addBoolean()  : ParseSchema
Adding Boolean Field.
addDate()  : ParseSchema
Adding Date Field.
addField()  : ParseSchema
Adding a Field to Create / Update a Schema.
addFile()  : ParseSchema
Adding File Field.
addGeoPoint()  : ParseSchema
Adding GeoPoint Field.
addIndex()  : ParseSchema
Adding an Index to Create / Update a Schema.
addNumber()  : ParseSchema
Adding Number Field.
addObject()  : ParseSchema
Adding Object Field.
addPointer()  : ParseSchema
Adding Pointer Field.
addPolygon()  : ParseSchema
Adding Polygon Field.
addRelation()  : ParseSchema
Adding Relation Field.
addString()  : ParseSchema
Adding String Field.
all()  : array<string|int, mixed>
Get all the Schema data on Parse.
assertClassName()  : mixed
Assert if ClassName has filled.
assertTypes()  : mixed
Assert types of fields.
delete()  : array<string|int, mixed>
Removing a Schema from Parse.
deleteField()  : mixed
Deleting a Field to Update on a Schema.
deleteIndex()  : mixed
Deleting an Index to Update on a Schema.
get()  : array<string|int, mixed>
Get the Schema from Parse.
purge()  : mixed
Removes all objects from a Schema (class) in Parse.
save()  : array<string|int, mixed>
Create a new Schema on Parse.
update()  : array<string|int, mixed>
Update a Schema from Parse.

Properties

$ARRAY

Array data type

public static string $ARRAY = 'Array'

$BOOLEAN

Boolean data type

public static string $BOOLEAN = 'Boolean'

$DATE

Date data type

public static string $DATE = 'Date'

$FILE

File data type

public static string $FILE = 'File'

$GEO_POINT

GeoPoint data type

public static string $GEO_POINT = 'GeoPoint'

$NUMBER

Number data type

public static string $NUMBER = 'Number'

$OBJECT

Object data type

public static string $OBJECT = 'Object'

$POINTER

Pointer data type

public static string $POINTER = 'Pointer'

$POLYGON

Polygon data type

public static string $POLYGON = 'Polygon'

$RELATION

Relation data type

public static string $RELATION = 'Relation'

$STRING

String data type

public static string $STRING = 'String'

$className

Class name for data stored on Parse.

private string $className

$fields

Fields to create.

private array<string|int, mixed> $fields = []

$indexes

Indexes to create.

private array<string|int, mixed> $indexes = []

Methods

__construct()

Create a Parse Schema.

public __construct([string|null $className = null ]) : mixed
Parameters
$className : string|null = null

Class Name of data on Parse.

Return values
mixed

addArray()

Adding Array Field.

public addArray([string $fieldName = null ]) : ParseSchema
Parameters
$fieldName : string = null

Name of the field will created on Parse

Tags
throws
Exception
Return values
ParseSchema

fields return self to create field on Parse

addBoolean()

Adding Boolean Field.

public addBoolean([string $fieldName = null ]) : ParseSchema
Parameters
$fieldName : string = null

Name of the field will created on Parse

Tags
throws
Exception
Return values
ParseSchema

fields return self to create field on Parse

addDate()

Adding Date Field.

public addDate([string $fieldName = null ]) : ParseSchema
Parameters
$fieldName : string = null

Name of the field will created on Parse

Tags
throws
Exception
Return values
ParseSchema

fields return self to create field on Parse

addField()

Adding a Field to Create / Update a Schema.

public addField([string $fieldName = null ][, string $fieldType = 'String' ]) : ParseSchema
Parameters
$fieldName : string = null

Name of the field that will be created on Parse

$fieldType : string = 'String'

Can be a (String|Number|Boolean|Date|File|GeoPoint|Array|Object|Pointer|Relation)

Tags
throws
Exception
Return values
ParseSchema

fields return self to create field on Parse

addFile()

Adding File Field.

public addFile([string $fieldName = null ]) : ParseSchema
Parameters
$fieldName : string = null

Name of the field will created on Parse

Tags
throws
Exception
Return values
ParseSchema

fields return self to create field on Parse

addGeoPoint()

Adding GeoPoint Field.

public addGeoPoint([string $fieldName = null ]) : ParseSchema
Parameters
$fieldName : string = null

Name of the field will created on Parse

Tags
throws
Exception
Return values
ParseSchema

fields return self to create field on Parse

addIndex()

Adding an Index to Create / Update a Schema.

public addIndex(string $indexName, string $index) : ParseSchema
Parameters
$indexName : string

Name of the index that will be created on Parse

$index : string

Key / Value to be saved

Tags
throws
Exception
Return values
ParseSchema

indexes return self to create index on Parse

addNumber()

Adding Number Field.

public addNumber([string $fieldName = null ]) : ParseSchema
Parameters
$fieldName : string = null

Name of the field will created on Parse

Tags
throws
Exception
Return values
ParseSchema

fields return self to create field on Parse

addObject()

Adding Object Field.

public addObject([string $fieldName = null ]) : ParseSchema
Parameters
$fieldName : string = null

Name of the field will created on Parse

Tags
throws
Exception
Return values
ParseSchema

fields return self to create field on Parse

addPointer()

Adding Pointer Field.

public addPointer([string $fieldName = null ][, string $targetClass = null ]) : ParseSchema
Parameters
$fieldName : string = null

Name of the field will created on Parse

$targetClass : string = null

Name of the target Pointer Class

Tags
throws
Exception
Return values
ParseSchema

fields return self to create field on Parse

addPolygon()

Adding Polygon Field.

public addPolygon([string $fieldName = null ]) : ParseSchema
Parameters
$fieldName : string = null

Name of the field will created on Parse

Tags
throws
Exception
Return values
ParseSchema

fields return self to create field on Parse

addRelation()

Adding Relation Field.

public addRelation([string $fieldName = null ][, string $targetClass = null ]) : ParseSchema
Parameters
$fieldName : string = null

Name of the field will created on Parse

$targetClass : string = null

Name of the target Pointer Class

Tags
throws
Exception
Return values
ParseSchema

fields return self to create field on Parse

addString()

Adding String Field.

public addString([string $fieldName = null ]) : ParseSchema
Parameters
$fieldName : string = null

Name of the field that will be created on Parse

Tags
throws
Exception
Return values
ParseSchema

fields return self to create field on Parse

all()

Get all the Schema data on Parse.

public all() : array<string|int, mixed>
Tags
throws
ParseException
Return values
array<string|int, mixed>

assertClassName()

Assert if ClassName has filled.

public assertClassName() : mixed
Tags
throws
Exception
Return values
mixed

assertTypes()

Assert types of fields.

public assertTypes([string $type = null ]) : mixed
Parameters
$type : string = null
Tags
throws
InvalidArgumentException
Return values
mixed

delete()

Removing a Schema from Parse.

public delete() : array<string|int, mixed>

You can only remove a schema from your app if it is empty (has 0 objects).

Tags
throws
Exception
Return values
array<string|int, mixed>

deleteField()

Deleting a Field to Update on a Schema.

public deleteField([string $fieldName = null ]) : mixed
Parameters
$fieldName : string = null

Name of the field will be deleted

Return values
mixed

deleteIndex()

Deleting an Index to Update on a Schema.

public deleteIndex([string $indexName = null ]) : mixed
Parameters
$indexName : string = null

Name of the index that will be deleted

Return values
mixed

get()

Get the Schema from Parse.

public get() : array<string|int, mixed>
Tags
throws
ParseException
Return values
array<string|int, mixed>

purge()

Removes all objects from a Schema (class) in Parse.

public purge() : mixed

EXERCISE CAUTION, running this will delete all objects for this schema and cannot be reversed

Tags
throws
Exception
Return values
mixed

save()

Create a new Schema on Parse.

public save() : array<string|int, mixed>
Tags
throws
Exception
Return values
array<string|int, mixed>

update()

Update a Schema from Parse.

public update() : array<string|int, mixed>
Tags
throws
Exception
Return values
array<string|int, mixed>

Search results