AddUniqueOperation

Implements \Parse\Internal\FieldOperation

Class AddUniqueOperation - Operation to add unique objects to an array key.

author

Fosco Marotto fjm@fb.com

package

Parse\Internal

Methods

Creates an operation for adding unique values to an array key.

__construct(array $objects) 
Throws
\Parse\ParseException

Arguments

$objects

array

Objects to add.

Apply the current operation and return the result.

_apply(mixed $oldValue, array $obj, string $key) : array

Arguments

$oldValue

mixed

Value prior to this operation.

$obj

array

Value being applied.

$key

string

Key this operation affects.

Response

array

Returns an associative array encoding of this operation.

_encode() : array

Response

array

Merge this operation with the previous operation and return the result.

_mergeWithPrevious(\Parse\Internal\FieldOperation $previous) : \Parse\Internal\FieldOperation
Throws
\Parse\ParseException

Arguments

$previous

\Parse\Internal\FieldOperation

Previous Operation.

Response

\Parse\Internal\FieldOperation

Merged Operation.

Returns the values for this operation.

getValue() : mixed

Response

mixed

Checks if a parse object is contained in a given array of values

isParseObjectInArray(\Parse\ParseObject $parseObject, array $oldValue) : boolean

Arguments

$parseObject

\Parse\ParseObject

ParseObject to check for existence of

$oldValue

array

Array to check if ParseObject is present in

Response

boolean

Properties

Array containing objects to add.

objects : array
var

Type(s)

array