Parse PHP SDK API Reference

IncrementOperation
in package
implements FieldOperation

Class IncrementOperation - Operation to increment numeric object key.

Tags
author

Fosco Marotto [email protected]

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

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
throws
ParseException
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>

getValue()

Get the value for this operation.

public getValue() : int
Return values
int

Search results