ParseRelation

Implements \Parse\Internal\Encodable

Class ParseRelation - A class that is used to access all of the children of a many-to-many relationship.

Each instance of ParseRelation is associated with a particular parent object and key.

author

Mohamed Madbouli mohamedmadbouli@fb.com

package

Parse

Methods

Creates a new Relation for the given parent object, key and class name of target objects.

__construct(\Parse\ParseObject $parent, string $key, string $targetClassName = null) 

Arguments

$parent

\Parse\ParseObject

The parent of this relation.

$key

string

The key of the relation in the parent object.

$targetClassName

string

The className of the target objects.

Return an encoded array of this relation.

_encode() : array

Response

array

Adds a ParseObject or an array of ParseObjects to the relation.

add(mixed $objects) 

Arguments

$objects

mixed

The item or items to add.

Gets a query that can be used to query the objects in this relation.

getQuery() : \Parse\ParseQuery

Response

\Parse\ParseQuery

That restricts the results to objects in this relations.

Returns the target classname for the relation.

getTargetClass() : string

Response

string

Removes a ParseObject or an array of ParseObjects from this relation.

remove(mixed $objects) 

Arguments

$objects

mixed

The item or items to remove.

Set the parent object for the relation.

setParent( $parent) 

Arguments

$parent

Set the target classname for the relation.

setTargetClass( $className) 

Arguments

$className

Properties

The parent of this relation.

parent : \Parse\ParseObject
var

Type(s)

\Parse\ParseObject

The key of the relation in the parent object.

key : string
var

Type(s)

string

The className of the target objects.

targetClassName : string
var

Type(s)

string