Coeus Framework  1.0
model Class Reference

Model Class Abstraction. More...

Inheritance diagram for model:
model_functions

Additional Inherited Members

- Public Member Functions inherited from model_functions
 addNew ()
 Adds a new (blank) document with a new _id. More...
 
 save ()
 Saves the current document as is. More...
 
 remove ()
 Removes the current document. More...
 
 find ($filter=[], $options=[])
 Finds document(s) based on filters and options. More...
 
 next ()
 Moves to the next document cursor. More...
 
 getAll ( $json=false)
 Returns all documents within the cursor. More...
 
 getCurrent ()
 Returns the current document. More...
 
 getId ( $idStr)
 Returns the BSON object _id. More...
 
 __set ($name, $value)
 
__get ($name)
 
 json ( $object)
 Returns an object as a JSON string. More...
 

Detailed Description

Model Class Abstraction.

This database model uses MongoDB as its backend. In that reguard, every table is a "collection" and every record is a "document." You must specify your "Schema" in your child class.

Author
David A. Lamkin dlamk.nosp@m.in@c.nosp@m.oupon.nosp@m.wall.nosp@m.et.co.nosp@m.m
Version
1.0
Warning
You MUST have a child model located in "\application\models\"
Example of a contacts database schema:
<?php
namespace application\models {
class people extends \framework\core\model {
private $first_name;
private $middle_name;
private $last_name;
private $phone;
private $address = [[
"street" => "",
"city" => "",
"state" => "",
"zip" => 0
]];
}
}
Usage Example:
$person = new people;
print( $person->find()->getAll(true) );

The documentation for this class was generated from the following file: