PHP Класс DB\Mongo\Mapper

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

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

Свойство Тип Описание
$collection
$cursor
$db
$document
$fields

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

Метод Описание
__construct ( Mongo $db, $collection, $fields = NULL ) : void Instantiate class
cast ( $obj = NULL ) : array Return fields of mapper object as an associative array
clear ( $key ) : null Delete field
copyfrom ( $var, $func = NULL ) : null Hydrate mapper object using hive array variable
copyto ( $key ) : null Populate hive array variable with mapper fields
count ( $filter = NULL, $ttl ) : integer Count records that match criteria
cursor ( ) : object | null Return the cursor from last query
dbtype ( ) : string Return database type
erase ( $filter = NULL ) : boolean Delete current record
exists ( $key ) : boolean Return TRUE if field is defined
fields ( ) : array Return field names
find ( $filter = NULL, array $options = NULL, $ttl ) : static[] Return records that match criteria
get ( $key ) : scalar | FALSE Retrieve value of field
getiterator ( ) : object Retrieve external iterator for fields
insert ( ) : array Insert new record
reset ( ) : null Reset cursor
select ( $fields = NULL, $filter = NULL, array $options = NULL, $ttl ) : static[] Build query and execute
set ( $key, $val ) : scalar | FALSE Assign value to field
skip ( $ofs = 1 ) : array Return record at specified offset using criteria of previous load() call and make it active
update ( ) : array Update current record

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

Метод Описание
factory ( $row ) : static Convert array to mapper object

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

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

Instantiate class
public __construct ( Mongo $db, $collection, $fields = NULL ) : void
$db DB\Mongo object
$collection string
$fields array
Результат void

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

Return fields of mapper object as an associative array
public cast ( $obj = NULL ) : array
$obj object
Результат array

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

Delete field
public clear ( $key ) : null
$key string
Результат null

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

Hydrate mapper object using hive array variable
public copyfrom ( $var, $func = NULL ) : null
$var array|string
$func callback
Результат null

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

Populate hive array variable with mapper fields
public copyto ( $key ) : null
$key string
Результат null

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

Count records that match criteria
public count ( $filter = NULL, $ttl ) : integer
$filter array
$ttl int
Результат integer

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

Return the cursor from last query
public cursor ( ) : object | null
Результат object | null

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

Return database type
public dbtype ( ) : string
Результат string

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

Delete current record
public erase ( $filter = NULL ) : boolean
$filter array
Результат boolean

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

Return TRUE if field is defined
public exists ( $key ) : boolean
$key string
Результат boolean

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

Convert array to mapper object
protected factory ( $row ) : static
$row array
Результат static

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

Return field names
public fields ( ) : array
Результат array

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

Return records that match criteria
public find ( $filter = NULL, array $options = NULL, $ttl ) : static[]
$filter array
$options array array
$ttl int
Результат static[]

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

Retrieve value of field
public get ( $key ) : scalar | FALSE
$key string
Результат scalar | FALSE

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

Retrieve external iterator for fields
public getiterator ( ) : object
Результат object

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

Insert new record
public insert ( ) : array
Результат array

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

Reset cursor
public reset ( ) : null
Результат null

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

Build query and execute
public select ( $fields = NULL, $filter = NULL, array $options = NULL, $ttl ) : static[]
$fields string
$filter array
$options array array
$ttl int
Результат static[]

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

Assign value to field
public set ( $key, $val ) : scalar | FALSE
$key string
$val scalar
Результат scalar | FALSE

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

Return record at specified offset using criteria of previous load() call and make it active
public skip ( $ofs = 1 ) : array
$ofs int
Результат array

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

Update current record
public update ( ) : array
Результат array

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

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

protected $collection

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

protected $cursor

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

protected $db

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

protected $document

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

protected $fields