AddOperation
in package
implements
FieldOperation
Class AddOperation - FieldOperation for adding object(s) to array fields.
Tags
Interfaces, Classes and Traits
- FieldOperation
- Class FieldOperation - Interface for all Parse Field Operations.
Table of Contents
- $objects : array<string|int, mixed>
- Array with objects to add.
- __construct() : mixed
- Creates an AddOperation with the provided objects.
- _apply() : array<string|int, mixed>
- Applies current operation, returns resulting value.
- _encode() : array<string|int, mixed>
- Returns associative array representing encoded operation.
- _mergeWithPrevious() : FieldOperation
- Takes a previous operation and returns a merged operation to replace it.
- getValue() : mixed
- Gets the objects for this operation.
Properties
$objects
Array with objects to add.
private
array<string|int, mixed>
$objects
Methods
__construct()
Creates an AddOperation with the provided objects.
public
__construct(array<string|int, mixed> $objects) : mixed
Parameters
- $objects : array<string|int, mixed>
-
Objects to add.
Tags
Return values
mixed —_apply()
Applies current operation, returns resulting value.
public
_apply(mixed $oldValue, mixed $obj, string $key) : array<string|int, mixed>
Parameters
- $oldValue : mixed
-
Value prior to this operation.
- $obj : mixed
-
Value being applied.
- $key : string
-
Key this operation affects.
Return values
array<string|int, mixed> —_encode()
Returns associative array representing encoded operation.
public
_encode() : array<string|int, mixed>
Return values
array<string|int, mixed> —_mergeWithPrevious()
Takes a previous operation and returns a merged operation to replace it.
public
_mergeWithPrevious(FieldOperation $previous) : FieldOperation
Parameters
- $previous : FieldOperation
-
Previous operation.
Tags
Return values
FieldOperation —Merged operation.
getValue()
Gets the objects for this operation.
public
getValue() : mixed