PHP Класс Sokil\Mongo\Operator

Наследование: implements Sokil\Mongo\ArrayableInterface
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
addToSet ( $field, $value )
addToSetEach ( $field, array $values )
bitwiceAnd ( $field, $value )
bitwiceOr ( $field, $value )
bitwiceXor ( $field, $value )
convertToArray ( mixed $mixed ) : array Transform operator in different formats to canonical array form
get ( $operation, $fieldName = null )
getAll ( ) : array
increment ( $fieldName, $value = 1 )
isDefined ( )
isReloadRequired ( )
pull ( integer | string | Expression | callable $expression, mixed | Expression | callable $value = null ) : Operator The $pull operator removes from an existing array all instances of a value or values that match a specified query.
push ( $fieldName, $value )
pushEach ( $fieldName, array $values )
pushEachPosition ( string $field, integer $position ) : Operator The $position modifier specifies the location in the array at which the $push operator insert elements. Without the $position modifier, the $push operator inserts elements to the end of the array. See $push modifiers for more information.
pushEachSlice ( string $field, integer $slice ) : Operator The $slice modifier limits the number of array elements during a $push operation. To project, or return, a specified number of array elements from a read operation, see the $slice projection operator instead.
pushEachSort ( string $field, array $sort ) : Operator The $sort modifier orders the elements of an array during a $push operation.
reset ( )
set ( $fieldName, $value )
toArray ( )
unsetField ( string $fieldName ) : Operator The $unset operator deletes a particular field

Описание методов

addToSet() публичный Метод

public addToSet ( $field, $value )

addToSetEach() публичный Метод

public addToSetEach ( $field, array $values )
$values array

bitwiceAnd() публичный Метод

public bitwiceAnd ( $field, $value )

bitwiceOr() публичный Метод

public bitwiceOr ( $field, $value )

bitwiceXor() публичный Метод

public bitwiceXor ( $field, $value )

convertToArray() публичный статический Метод

Transform operator in different formats to canonical array form
public static convertToArray ( mixed $mixed ) : array
$mixed mixed
Результат array

get() публичный Метод

public get ( $operation, $fieldName = null )

getAll() публичный Метод

Устаревший: since v.1.13 use Operator::toArray()
public getAll ( ) : array
Результат array

increment() публичный Метод

public increment ( $fieldName, $value = 1 )

isDefined() публичный Метод

public isDefined ( )

isReloadRequired() публичный Метод

public isReloadRequired ( )

pull() публичный Метод

The $pull operator removes from an existing array all instances of a value or values that match a specified query.
public pull ( integer | string | Expression | callable $expression, mixed | Expression | callable $value = null ) : Operator
$expression integer | string | Expression | callable
$value mixed | Expression | callable
Результат Operator

push() публичный Метод

public push ( $fieldName, $value )

pushEach() публичный Метод

public pushEach ( $fieldName, array $values )
$values array

pushEachPosition() публичный Метод

The $position modifier specifies the location in the array at which the $push operator insert elements. Without the $position modifier, the $push operator inserts elements to the end of the array. See $push modifiers for more information.
public pushEachPosition ( string $field, integer $position ) : Operator
$field string
$position integer non-negative number that corresponds to the position in the array, based on a zero-based index
Результат Operator

pushEachSlice() публичный Метод

The $slice modifier limits the number of array elements during a $push operation. To project, or return, a specified number of array elements from a read operation, see the $slice projection operator instead.
public pushEachSlice ( string $field, integer $slice ) : Operator
$field string
$slice integer
Результат Operator

pushEachSort() публичный Метод

The $sort modifier orders the elements of an array during a $push operation.
public pushEachSort ( string $field, array $sort ) : Operator
$field string
$sort array
Результат Operator

reset() публичный Метод

public reset ( )

set() публичный Метод

public set ( $fieldName, $value )

toArray() публичный Метод

public toArray ( )

unsetField() публичный Метод

The $unset operator deletes a particular field
public unsetField ( string $fieldName ) : Operator
$fieldName string
Результат Operator