ParseSchema

Class ParseSchema - Handles schemas data from Parse.

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

see
author

Júlio César Gonçalves de Oliveira julio@pinguineras.com.br

package

Parse

Methods

Create a Parse Schema.

__construct(string|null $className = null) 

Arguments

$className

string|null

Class Name of data on Parse.

Adding Array Field.

addArray(string $fieldName = null) : \Parse\ParseSchema
Throws
\Exception

Arguments

$fieldName

string

Name of the field will created on Parse

Response

\Parse\ParseSchema

fields return self to create field on Parse

Adding Boolean Field.

addBoolean(string $fieldName = null) : \Parse\ParseSchema
Throws
\Exception

Arguments

$fieldName

string

Name of the field will created on Parse

Response

\Parse\ParseSchema

fields return self to create field on Parse

Adding Date Field.

addDate(string $fieldName = null) : \Parse\ParseSchema
Throws
\Exception

Arguments

$fieldName

string

Name of the field will created on Parse

Response

\Parse\ParseSchema

fields return self to create field on Parse

Adding a Field to Create / Update a Schema.

addField(string $fieldName = null, string $fieldType = 'String') : \Parse\ParseSchema
Throws
\Exception

Arguments

$fieldName

string

Name of the field that will be created on Parse

$fieldType

string

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

Response

\Parse\ParseSchema

fields return self to create field on Parse

Adding File Field.

addFile(string $fieldName = null) : \Parse\ParseSchema
Throws
\Exception

Arguments

$fieldName

string

Name of the field will created on Parse

Response

\Parse\ParseSchema

fields return self to create field on Parse

Adding GeoPoint Field.

addGeoPoint(string $fieldName = null) : \Parse\ParseSchema
Throws
\Exception

Arguments

$fieldName

string

Name of the field will created on Parse

Response

\Parse\ParseSchema

fields return self to create field on Parse

Adding an Index to Create / Update a Schema.

addIndex(string $indexName, string $index) : \Parse\ParseSchema
Throws
\Exception

Arguments

$indexName

string

Name of the index that will be created on Parse

$index

string

Key / Value to be saved

Response

\Parse\ParseSchema

indexes return self to create index on Parse

Adding Number Field.

addNumber(string $fieldName = null) : \Parse\ParseSchema
Throws
\Exception

Arguments

$fieldName

string

Name of the field will created on Parse

Response

\Parse\ParseSchema

fields return self to create field on Parse

Adding Object Field.

addObject(string $fieldName = null) : \Parse\ParseSchema
Throws
\Exception

Arguments

$fieldName

string

Name of the field will created on Parse

Response

\Parse\ParseSchema

fields return self to create field on Parse

Adding Pointer Field.

addPointer(string $fieldName = null, string $targetClass = null) : \Parse\ParseSchema
Throws
\Exception

Arguments

$fieldName

string

Name of the field will created on Parse

$targetClass

string

Name of the target Pointer Class

Response

\Parse\ParseSchema

fields return self to create field on Parse

Adding Polygon Field.

addPolygon(string $fieldName = null) : \Parse\ParseSchema
Throws
\Exception

Arguments

$fieldName

string

Name of the field will created on Parse

Response

\Parse\ParseSchema

fields return self to create field on Parse

Adding Relation Field.

addRelation(string $fieldName = null, string $targetClass = null) : \Parse\ParseSchema
Throws
\Exception

Arguments

$fieldName

string

Name of the field will created on Parse

$targetClass

string

Name of the target Pointer Class

Response

\Parse\ParseSchema

fields return self to create field on Parse

Adding String Field.

addString(string $fieldName = null) : \Parse\ParseSchema
Throws
\Exception

Arguments

$fieldName

string

Name of the field that will be created on Parse

Response

\Parse\ParseSchema

fields return self to create field on Parse

Get all the Schema data on Parse.

all() : array
Throws
\Parse\ParseException

Response

array

Assert if ClassName has filled.

assertClassName() 
Throws
\Exception

Assert types of fields.

assertTypes(string $type = null) 
Throws
\InvalidArgumentException

Arguments

$type

string

Removing a Schema from Parse.

delete() : array

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

Throws
\Exception

Response

array

Deleting a Field to Update on a Schema.

deleteField(string $fieldName = null) 

Arguments

$fieldName

string

Name of the field will be deleted

Deleting an Index to Update on a Schema.

deleteIndex(string $indexName = null) 

Arguments

$indexName

string

Name of the index that will be deleted

Get the Schema from Parse.

get() : array
Throws
\Parse\ParseException

Response

array

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

purge() 

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

Throws
\Exception

Create a new Schema on Parse.

save() : array
Throws
\Exception

Response

array

Update a Schema from Parse.

update() : array
Throws
\Exception

Response

array

Properties

String data type

STRING : string
static
var

Type(s)

string

Number data type

NUMBER : string
static
var

Type(s)

string

Boolean data type

BOOLEAN : string
static
var

Type(s)

string

Date data type

DATE : string
static
var

Type(s)

string

File data type

FILE : string
static
var

Type(s)

string

GeoPoint data type

GEO_POINT : string
static
var

Type(s)

string

Polygon data type

POLYGON : string
static
var

Type(s)

string

Array data type

ARRAY : string
static
var

Type(s)

string

Object data type

OBJECT : string
static
var

Type(s)

string

Pointer data type

POINTER : string
static
var

Type(s)

string

Relation data type

RELATION : string
static
var

Type(s)

string

Class name for data stored on Parse.

className : string
var

Type(s)

string

Fields to create.

fields : array
var

Type(s)

array

Indexes to create.

indexes : array
var

Type(s)

array

Force to use master key in Schema Methods.

useMasterKey : boolean
see
var

Type(s)

boolean