PHP Class Sokil\Mongo\Operator

Inheritance: implements Sokil\Mongo\ArrayableInterface
Afficher le fichier Open project: sokil/php-mongo Class Usage Examples

Méthodes publiques

Méthode Description
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

Method Details

addToSet() public méthode

public addToSet ( $field, $value )

addToSetEach() public méthode

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

bitwiceAnd() public méthode

public bitwiceAnd ( $field, $value )

bitwiceOr() public méthode

public bitwiceOr ( $field, $value )

bitwiceXor() public méthode

public bitwiceXor ( $field, $value )

convertToArray() public static méthode

Transform operator in different formats to canonical array form
public static convertToArray ( mixed $mixed ) : array
$mixed mixed
Résultat array

get() public méthode

public get ( $operation, $fieldName = null )

getAll() public méthode

Deprecation: since v.1.13 use Operator::toArray()
public getAll ( ) : array
Résultat array

increment() public méthode

public increment ( $fieldName, $value = 1 )

isDefined() public méthode

public isDefined ( )

isReloadRequired() public méthode

public isReloadRequired ( )

pull() public méthode

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
Résultat Operator

push() public méthode

public push ( $fieldName, $value )

pushEach() public méthode

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

pushEachPosition() public méthode

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
Résultat Operator

pushEachSlice() public méthode

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
Résultat Operator

pushEachSort() public méthode

The $sort modifier orders the elements of an array during a $push operation.
public pushEachSort ( string $field, array $sort ) : Operator
$field string
$sort array
Résultat Operator

reset() public méthode

public reset ( )

set() public méthode

public set ( $fieldName, $value )

toArray() public méthode

public toArray ( )

unsetField() public méthode

The $unset operator deletes a particular field
public unsetField ( string $fieldName ) : Operator
$fieldName string
Résultat Operator