PHP Класс League\Monga\Query\Update

Наследование: extends League\Monga\Query\Where
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$atomic boolean whether to use atomic mode
$multiple boolean whether to update multiple or only one
$update array @update update query
$upsert boolean whether to allow upserts

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

Метод Описание
addToSet ( string $field, mixed $value ) : object Adds the values to the set or upsert when the dataset doesn't contain them already
atomic ( boolean $atomic = true ) : object Set the multiple option.
getOptions ( ) : array Returns the query options
getUpdate ( ) : array Returns the formatted update query.
increment ( string $field, integer $by = 1 ) : object Increments a field value.
multiple ( boolean $multiple = true ) : object Set the multiple option.
pop ( string $field ) : object Removes an item off the ending of a field array.
pull ( string $field, string $value, string $operator = null, boolean $all = false ) : object Removes all matched instances from a field array
pullAll ( string $field, string $value, string $operator = null ) : object Removes all matched instances from a field array
push ( string $field, mixed $value, boolean $all = false ) : object Pushes a value onto a field array
pushAll ( string $field, array $values ) : object Pushes a value onto a field array
remove ( string $field ) : object Removes a field from a document.
rename ( string $field, string $to ) : object Rename a field.
set ( string $field, string $value = null ) : object Update the field from a document.
single ( boolean $single = true ) : object Set the multiple option negatively.
unshift ( string $field ) : object Removes an item off the beginning of a field array.
upsert ( boolean $upsert = true ) : object Set the upsert option.

Защищенные методы

Метод Описание
update ( string $type, string $field, mixed $value ) Sets the value of the insert.

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

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

Adds the values to the set or upsert when the dataset doesn't contain them already
public addToSet ( string $field, mixed $value ) : object
$field string field name
$value mixed value to set/upsert with
Результат object $this

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

Set the multiple option.
public atomic ( boolean $atomic = true ) : object
$atomic boolean whether to use atomic more
Результат object $this

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

Returns the query options
public getOptions ( ) : array
Результат array query options

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

Returns the formatted update query.
public getUpdate ( ) : array
Результат array update query

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

Increments a field value.
public increment ( string $field, integer $by = 1 ) : object
$field string field to increment
$by integer value to increment by
Результат object $this

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

Set the multiple option.
public multiple ( boolean $multiple = true ) : object
$multiple boolean whether to allow multiple updates
Результат object $this

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

Removes an item off the ending of a field array.
public pop ( string $field ) : object
$field string field name
Результат object $this

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

Removes all matched instances from a field array
public pull ( string $field, string $value, string $operator = null, boolean $all = false ) : object
$field string field to unshift
$value string values to remove
$operator string condition operator
$all boolean
Результат object $this

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

Removes all matched instances from a field array
public pullAll ( string $field, string $value, string $operator = null ) : object
$field string field to unshift
$value string values to remove
$operator string condition operator
Результат object $this

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

Pushes a value onto a field array
public push ( string $field, mixed $value, boolean $all = false ) : object
$field string field name
$value mixed value to append to the array
$all boolean whether to remove all (must be array)
Результат object $this

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

Pushes a value onto a field array
public pushAll ( string $field, array $values ) : object
$field string field name
$values array value to append to the array
Результат object $this

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

Removes a field from a document.
public remove ( string $field ) : object
$field string field to remove
Результат object $this

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

Rename a field.
public rename ( string $field, string $to ) : object
$field string field name
$to string new field name
Результат object $this

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

Update the field from a document.
public set ( string $field, string $value = null ) : object
$field string field name
$value string new value
Результат object $this

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

Set the multiple option negatively.
public single ( boolean $single = true ) : object
$single boolean whether to allow single updates
Результат object $this

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

Removes an item off the beginning of a field array.
public unshift ( string $field ) : object
$field string field name
Результат object $this

update() защищенный Метод

Sets the value of the insert.
protected update ( string $type, string $field, mixed $value )
$type string update modifier
$field string field to update
$value mixed update value

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

Set the upsert option.
public upsert ( boolean $upsert = true ) : object
$upsert boolean whether to allow upserts
Результат object $this

Описание свойств

$atomic защищенное свойство

whether to use atomic mode
protected bool $atomic
Результат boolean

$multiple защищенное свойство

whether to update multiple or only one
protected bool $multiple
Результат boolean

$update защищенное свойство

@update update query
protected array $update
Результат array

$upsert защищенное свойство

whether to allow upserts
protected bool $upsert
Результат boolean