Class ArrayOperation
Array opertion - Add, Remove, AddUnique
-
LeanCloud\Operation\ArrayOperation
implements
LeanCloud\Operation\IOperation
Methods summary
public
|
#
__construct( string $key, array $val, string $opType )
Initialize an ArrayOperation
Initialize an ArrayOperation
Parameters
- $key
- Field key
- $val
- Array of values to add or remove
- $opType
- One of Add, AddUnique, Remove
Throws
RuntimeException, InvalidArgumentException
|
public
string
|
#
getKey( )
Get key of field the operation applies to.
Get key of field the operation applies to.
Returns
string
|
public
string
|
#
getOpType( )
Get type of operation
Returns
string
|
public
mixed
|
#
getValue( )
Get value of operation
Returns
mixed
|
public
array
|
#
encode( )
Encode to JSON represented operation
Encode to JSON represented operation
Returns
array
Implementation of
|
public
array
|
#
applyOn( array $oldval )
Apply this operation based on old array.
Apply this operation based on old array.
Parameters
Returns
array
Throws
RuntimeException
Implementation of
|
public
LeanCloud\Operation\IOperation
|
|