ParseRole

Extends \Parse\ParseObject

Class ParseRole - Representation of an access Role.

author

Fosco Marotto fjm@fb.com

package

Parse

Methods

Create a Parse Object.

__construct(string $className = null, mixed $objectId = null, boolean $isPointer = false) 
inherited

Creates a pointer object if an objectId is provided, otherwise creates a new object.

Throws
\Exception

Arguments

$className

string

Class Name for data on Parse.

$objectId

mixed

Object Id for Existing object.

$isPointer

boolean

Getter to catch direct property calls and pass them to the get function.

__get(string $key) : mixed
inherited

Arguments

$key

string

Key to retrieve from the Object.

Response

mixed

Magic handler to catch isset calls to object properties.

__isset(string $key) : boolean
inherited

Arguments

$key

string

Key to check on the object.

Response

boolean

Setter to catch property calls and protect certain fields.

__set(string $key, mixed $value) 
inherited
Throws
\Exception

Arguments

$key

string

Key to set a value on.

$value

mixed

Value to assign.

Return a JSON encoded value of the object.

_encode() : string
inherited

Response

string

Returns whether or not data is available for a given key

_isDataAvailable(string $key) : boolean
inherited

Arguments

$key

string

Key to check availability of

Response

boolean

Detects if the object (and optionally the child objects) has unsaved changes.

_isDirty(boolean $considerChildren) : boolean
inherited

Arguments

$considerChildren

boolean

Whether to consider children when checking for dirty state

Response

boolean

Merges data received from the server.

_mergeAfterFetch(array $result, boolean $completeData = true) 
inherited

Arguments

$result

array

Data retrieved from the server.

$completeData

boolean

Fetch all data or not.

Merges data received from the server with a given selected keys.

_mergeAfterFetchWithSelectedKeys(array $result, array $selectedKeys) 
inherited

Arguments

$result

array

Data retrieved from the server.

$selectedKeys

array

Keys to be fetched. Null or empty means all data will be fetched.

Handle merging of special fields for the object.

_mergeMagicFields( &$data) 
inherited

Arguments

$data

Perform an operation on an object property.

_performOperation(string $key, \Parse\Internal\FieldOperation $operation) 
inherited

Arguments

$key

string

Key to perform an operation upon.

$operation

\Parse\Internal\FieldOperation

Operation to perform.

Gets a Pointer referencing this Object.

_toPointer() : array
inherited
Throws
\Exception

Response

array

Un-register a subclass.

_unregisterSubclass() 
inherited static

Cannot be called on the base class ParseObject.

Add a value to an array property.

add(string $key, mixed $value) 
inherited

Arguments

$key

string

Key for array value on object to add a value to.

$value

mixed

Value to add.

Add unique values to an array property.

addUnique(string $key, mixed $value) 
inherited

Arguments

$key

string

Key for array value on object.

$value

mixed

Value list to add uniquely.

Apply operations to a target object.

applyOperations(array $operations,  &$target) 
inherited

Arguments

$operations

array

Operations set to apply.

$target

Before save stub

beforeSave() : void
inherited

Determine if the current object can be serialized for saving.

canBeSerialized() : boolean
inherited

Response

boolean

Checks the given object and any children to see if the whole object can be serialized for saving.

canBeSerializedAsValue(mixed $object) : boolean
inherited static

Arguments

$object

mixed

The value to check.

Response

boolean

Clear all keys on this object by creating delete operations for each key.

clear() 
inherited

Static method which returns a new Parse Object for a given class Optionally creates a pointer object if the objectId is provided.

create(string $className, string $objectId = null, boolean $isPointer = false) : \Parse\ParseObject
inherited static

Arguments

$className

string

Class Name for data on Parse.

$objectId

string

Unique identifier for existing object.

$isPointer

boolean

If the object is a pointer.

Response

\Parse\ParseObject

Create a ParseRole object with a given name and ACL.

createRole(string $name, \Parse\ParseACL $acl) : \Parse\ParseRole
static

Arguments

$name

string

Response

\Parse\ParseRole

Decodes and returns a ParseObject from an encoded object

decode(string|array $encoded) : \Parse\ParseObject
inherited static
Throws
\Parse\ParseException

Arguments

$encoded

string|array

Encoded ParseObject to decode

Response

\Parse\ParseObject

Save object and unsaved children within.

deepSave(\Parse\ParseObject|array $target, boolean $useMasterKey = false) 
inherited static
Throws
\Exception
\Parse\ParseAggregateException
\Parse\ParseException

Arguments

$target

\Parse\ParseObject|array

$useMasterKey

boolean

Whether to use the Master Key.

Delete a key from an object.

delete(string $key) 
inherited

Arguments

$key

string

Key to remove from object.

Delete the object from Parse.

destroy(boolean $useMasterKey = false) 
inherited

Arguments

$useMasterKey

boolean

Whether to use the master key.

Delete an array of objects.

destroyAll(array $objects, boolean $useMasterKey = false) 
inherited static
Throws
\Parse\ParseAggregateException

Arguments

$objects

array

Objects to destroy.

$useMasterKey

boolean

Whether to use the master key or not.

Destroy batch of objects.

destroyBatch(array<mixed,\Parse\ParseObject> $objects, boolean $useMasterKey = false) : array
inherited static
Throws
\Parse\ParseException

Arguments

$objects

array<mixed,\Parse\ParseObject>

$useMasterKey

boolean

Response

array

Returns a JSON encoded array of a ParseObject

encode() : string
inherited

Response

string

Fetch the whole object from the server and update the local object.

fetch(boolean $useMasterKey = false) : \Parse\ParseObject
inherited

Arguments

$useMasterKey

boolean

Whether to use the master key and override ACLs

Response

\Parse\ParseObject

Returns self, so you can chain this call.

Fetch an array of Parse objects from the server.

fetchAll(array $objects, boolean $useMasterKey = false) : array
inherited static

Arguments

$objects

array

The ParseObjects to fetch

$useMasterKey

boolean

Whether to override ACLs

Response

array

Find unsaved children inside an object.

findUnsavedChildren(\Parse\ParseObject $object,  &$unsavedChildren,  &$unsavedFiles) 
inherited static

Arguments

$object

\Parse\ParseObject

Object to search.

$unsavedChildren

$unsavedFiles

Get current value for an object property.

get(string $key) : mixed
inherited
Throws
\Exception

Arguments

$key

string

Key to retrieve from the estimatedData array.

Response

mixed

Get the ACL assigned to the object.

getACL() : \Parse\ParseACL
inherited

Response

\Parse\ParseACL

Internally retrieves the ACL assigned to this object, conditionally returning a copy of the existing one

getACLWithCopy(boolean $mayCopy) : \Parse\ParseACL|null
inherited

Arguments

$mayCopy

boolean

Whether to return a copy of this acl or not

Response

\Parse\ParseACL|null

Get values for all keys of an object.

getAllKeys() : array
inherited

Response

array

Get the Parse Class Name for the object.

getClassName() : string
inherited

Response

string

Get the createdAt for the object, or null if unsaved.

getCreatedAt() : \DateTime|null
inherited

Response

\DateTime|null

Returns the role name.

getName() : string

Response

string

Get the objectId for the object, or null if unsaved.

getObjectId() : string|null
inherited

Response

string|null

Get the registered subclass for a Parse class, or a generic ParseObject if no subclass is registered.

getRegisteredSubclass( $parseClassName) : \Parse\ParseObject
inherited static

Arguments

$parseClassName

Response

\Parse\ParseObject

Access or create a Relation value for a key.

getRelation(string $key, string $className = null) : \Parse\ParseRelation
inherited

Arguments

$key

string

The key to access the relation for.

$className

string

The target class name.

Response

\Parse\ParseRelation

The ParseRelation object if the relation already exists for the key or can be created for this key.

Gets the ParseRelation for the ParseRoles which are direct children of this role. These roles' users are granted any privileges that this role has been granted.

getRoles() : \Parse\ParseRelation

Returns JSON object of the unsaved operations.

getSaveJSON() : array
inherited

Response

array

Gets the Subclass className if exists, otherwise false.

getSubclass() 
inherited static

Get the updatedAt for the object, or null if unsaved.

getUpdatedAt() : \DateTime|null
inherited

Response

\DateTime|null

Gets the ParseRelation for the ParseUsers which are direct children of this role. These users are granted any privileges that this role has been granted.

getUsers() : \Parse\ParseRelation

Check if the object has a given key.

has(string $key) : boolean
inherited

Arguments

$key

string

Key to check

Response

boolean

Determines whether this object has child objects that are dirty

hasDirtyChildren() : boolean
inherited

Response

boolean

Check whether there is a subclass registered for a given parse class.

hasRegisteredSubclass( $parseClassName) : boolean
inherited static

Arguments

$parseClassName

Response

boolean

Increment a numeric key by a certain value.

increment(string $key, integer $value = 1) 
inherited

Arguments

$key

string

Key for numeric value on object to increment.

$value

integer

Value to increment by.

Returns true if the object has been fetched.

isDataAvailable() : boolean
inherited

Response

boolean

Check if the object or any of its child objects have unsaved operations.

isDirty() : boolean
inherited

Response

boolean

Check if the a value associated with a key has been added/updated/removed and not saved yet.

isKeyDirty(string $key) : boolean
inherited

Arguments

$key

string

Response

boolean

Merge server data after a save completes.

mergeAfterSave(array $result) 
inherited

Arguments

$result

array

Data retrieved from server.

Merge data from other object.

mergeFromObject(\Parse\ParseObject $other) 
inherited

Arguments

$other

\Parse\ParseObject

Other object to merge data from

Merges data received from the server.

mergeFromServer(array $data, boolean $completeData = true) 
inherited

Arguments

$data

array

Data retrieved from server.

$completeData

boolean

Fetch all data or not.

Creates a ParseQuery for the subclass of ParseObject.

query() : \Parse\ParseQuery
inherited static

Cannot be called on the base class ParseObject.

Throws
\Exception

Response

\Parse\ParseQuery

Start from serverData and process operations to generate the current value set for an object.

rebuildEstimatedData() 
inherited

Register a subclass. Should be called before any other Parse functions.

registerSubclass() 
inherited static

Cannot be called on the base class ParseObject.

Throws
\Exception

Remove a value from an array for an object key.

remove(string $key, mixed $value) 
inherited
Throws
\Exception

Arguments

$key

string

Key to remove the value from on the object.

$value

mixed

Value to remove from the array.

Revert all unsaved operations.

revert() 
inherited

Save Object to Parse.

save(boolean $useMasterKey = false) 
inherited

Arguments

$useMasterKey

boolean

Whether to use the Master Key.

Save all the objects in the provided array.

saveAll(array $list, boolean $useMasterKey = false) 
inherited static

Arguments

$list

array

$useMasterKey

boolean

Whether to use the Master Key.

Validate and set a value for an object key.

set(string $key, mixed $value) 
inherited
Throws
\Exception

Arguments

$key

string

Key to set a value for on the object.

$value

mixed

Value to set on the key.

Set ACL for this object.

setACL(\Parse\ParseACL $acl) 
inherited

Arguments

Set an array value for an object key.

setArray(string $key, array $value) 
inherited
Throws
\Exception

Arguments

$key

string

Key to set the value for on the object.

$value

array

Value to set on the key.

Set an associative array value for an object key.

setAssociativeArray(string $key, array $value) 
inherited
Throws
\Exception

Arguments

$key

string

Key to set the value for on the object.

$value

array

Value to set on the key.

Sets the role name.

setName(string $name) 
Throws
\Parse\ParseException

Arguments

$name

string

The role name

Creates an array of object ids from a given array of ParseObjects

toObjectIdArray(array $objects) : array
inherited static
Throws
\Parse\ParseException

Arguments

$objects

array

Objects to create id array from

Response

array

Traverse object to find children.

traverse(boolean $deep,  &$object, callable $mapFunction, array $seen = array()) : mixed
inherited static

Arguments

$deep

boolean

Should this call traverse deeply

$object

$mapFunction

callable

Function to call for every item.

$seen

array

Objects already seen.

Response

mixed

The result of calling mapFunction on the root object.

Merges an existing array of objects with their fetched counterparts

updateWithFetchedResults(array $objects, array $fetched) : array
inherited static
Throws
\Parse\ParseException

Arguments

$objects

array

Original objects to update

$fetched

array

Fetched object data to update with

Response

array

Properties

Parse Class name, overridden by classes subclassing ParseObject

parseClassName : string
inherited static
var

Type(s)

string

Data as it exists on the server.

serverData : array
inherited
var

Type(s)

array

Set of unsaved operations.

operationSet : array
inherited
var

Type(s)

array

Estimated value of applying operationSet to serverData.

estimatedData : array
inherited
var

Type(s)

array

Determine if data available for a given key or not.

dataAvailability : array
inherited
var

Type(s)

array

Class name for data on Parse.

className : string
inherited
var

Type(s)

string

Unique identifier on Parse.

objectId : string
inherited
var

Type(s)

string

Timestamp when object was created.

createdAt : \DateTime
inherited
var

Type(s)

\DateTime

Timestamp when object was last updated.

updatedAt : \DateTime
inherited
var

Type(s)

\DateTime

Whether the object has been fully fetched from Parse.

hasBeenFetched : boolean
inherited
var

Type(s)

boolean

Holds the registered subclasses and Parse class names.

registeredSubclasses : array
inherited static
var

Type(s)

array