IncrementOperation
in package
implements
FieldOperation
Class IncrementOperation - Operation to increment numeric object key.
Tags
Interfaces, Classes and Traits
- FieldOperation
- Class FieldOperation - Interface for all Parse Field Operations.
Table of Contents
- $value : int
- Amount to increment by.
- __construct() : mixed
- Creates an IncrementOperation object.
- _apply() : int
- Apply the current operation and return the result.
- _encode() : array<string|int, mixed>
- Get an associative array encoding for this operation.
- _mergeWithPrevious() : FieldOperation
- Merge this operation with a previous operation and return the resulting operation.
- getValue() : int
- Get the value for this operation.
Properties
$value
Amount to increment by.
private
int
$value
Methods
__construct()
Creates an IncrementOperation object.
public
__construct([int $value = 1 ]) : mixed
Parameters
- $value : int = 1
-
Amount to increment by.
Return values
mixed —_apply()
Apply the current operation and return the result.
public
_apply(mixed $oldValue, mixed $object, string $key) : int
Parameters
- $oldValue : mixed
-
Value prior to this operation.
- $object : mixed
-
Value for this operation.
- $key : string
-
Key to set Value on.
Tags
Return values
int —New value after application.
_encode()
Get an associative array encoding for this operation.
public
_encode() : array<string|int, mixed>
Return values
array<string|int, mixed> —_mergeWithPrevious()
Merge this operation with a previous operation and return the resulting operation.
public
_mergeWithPrevious(FieldOperation $previous) : FieldOperation
Parameters
- $previous : FieldOperation
-
Previous Operation.
Tags
Return values
FieldOperation —getValue()
Get the value for this operation.
public
getValue() : int