Fat-Free Framework: DB\Mongo\Mapper Class Reference

Fat-Free-Framework

Fat-Free Framework  3.1.0 API Reference

MongoDB mapper. More...

Inheritance diagram for DB\Mongo\Mapper:
DB\Cursor Magic DB\Mongo\Session

Public Member Functions

 exists ($key)
 
 set ($key, $val)
 
 get ($key)
 
 clear ($key)
 
 cast ($obj=NULL)
 
 select ($fields=NULL, $filter=NULL, array $options=NULL, $ttl=0)
 
 find ($filter=NULL, array $options=NULL, $ttl=0)
 
 count ($filter=NULL, $ttl=0)
 
 skip ($ofs=1)
 
 insert ()
 
 update ()
 
 erase ($filter=NULL)
 
 reset ()
 
 copyfrom ($key)
 
 copyto ($key)
 
 __construct (\DB\Mongo $db, $collection)
 
- Public Member Functions inherited from DB\Cursor
 find ($filter=NULL, array $options=NULL)
 
 insert ()
 
 update ()
 
 dry ()
 
 findone ($filter=NULL, array $options=NULL, $ttl=0)
 
 paginate ($pos=0, $size=10, $filter=NULL, array $options=NULL)
 
 load ($filter=NULL, array $options=NULL)
 
 first ()
 
 last ()
 
 skip ($ofs=1)
 
 next ()
 
 prev ()
 
 save ()
 
 erase ()
 
 reset ()
 
- Public Member Functions inherited from Magic
 exists ($key)
 
 set ($key, $val)
 
 get ($key)
 
 clear ($key)
 
 offsetexists ($key)
 
 __isset ($key)
 
 offsetset ($key, $val)
 
 __set ($key, $val)
 
 offsetget ($key)
 
 __get ($key)
 
 offsetunset ($key)
 
 __unset ($key)
 

Public Attributes

 $collection
 Mongo collection.
 
 $document =array()
 Mongo document.
 
- Public Attributes inherited from DB\Cursor
 $ptr =0
 Current position.
 
const E_Field ='Undefined field %s'
 

Protected Member Functions

 factory ($row)
 

Protected Attributes

 $db
 MongoDB wrapper.
 
- Protected Attributes inherited from DB\Cursor
 $query =array()
 Query results.
 

Detailed Description

MongoDB mapper.

Constructor & Destructor Documentation

DB\Mongo\Mapper::__construct ( \DB\Mongo  $db,
  $collection 
)

Instantiate class

Returns
void
Parameters
$dbobject
$collectionstring

Member Function Documentation

DB\Mongo\Mapper::cast (   $obj = NULL)

Return fields of mapper object as an associative array

Returns
array
Parameters
$objobject
DB\Mongo\Mapper::clear (   $key)

Delete field

Returns
NULL
Parameters
$keystring
DB\Mongo\Mapper::copyfrom (   $key)

Hydrate mapper object using hive array variable

Returns
NULL
Parameters
$keystring
DB\Mongo\Mapper::copyto (   $key)

Populate hive array variable with mapper fields

Returns
NULL
Parameters
$keystring
DB\Mongo\Mapper::count (   $filter = NULL,
  $ttl = 0 
)

Count records that match criteria

Returns
int
Parameters
$filterarray
$ttlint
DB\Mongo\Mapper::erase (   $filter = NULL)

Delete current record

Returns
bool
Parameters
$filterarray
DB\Mongo\Mapper::exists (   $key)

Return TRUE if field is defined

Returns
bool
Parameters
$keystring
DB\Mongo\Mapper::factory (   $row)
protected

Convert array to mapper object

Returns
object
Parameters
$rowarray
DB\Mongo\Mapper::find (   $filter = NULL,
array  $options = NULL,
  $ttl = 0 
)

Return records that match criteria

Returns
array
Parameters
$filterarray
$optionsarray
$ttlint
DB\Mongo\Mapper::get (   $key)

Retrieve value of field

Returns
scalar|FALSE
Parameters
$keystring
DB\Mongo\Mapper::insert ( )

Insert new record

Returns
array
DB\Mongo\Mapper::reset ( )

Reset cursor

Returns
NULL
DB\Mongo\Mapper::select (   $fields = NULL,
  $filter = NULL,
array  $options = NULL,
  $ttl = 0 
)

Build query and execute

Returns
array
Parameters
$fieldsstring
$filterarray
$optionsarray
$ttlint
DB\Mongo\Mapper::set (   $key,
  $val 
)

Assign value to field

Returns
scalar|FALSE
Parameters
$keystring
$valscalar
DB\Mongo\Mapper::skip (   $ofs = 1)

Return record at specified offset using criteria of previous load() call and make it active

Returns
array
Parameters
$ofsint
DB\Mongo\Mapper::update ( )

Update current record

Returns
array

The documentation for this class was generated from the following file:
  • db/mongo/mapper.php
Generated on Mon Aug 19 2013 21:28:03 for Fat-Free Framework by   doxygen 1.8.4