ODM (Object-Document Mapper)

In addition to its ability to map tables in relational databases, Phalcon can map documents from NoSQL databases. The ODM offers a CRUD functionality, events, validations among other services. Due to the absence of SQL queries and planners, NoSQL databases can see real improvements in performance using the Phalcon approach. Additionally, there are no SQL building reducing the possibility of SQL injections. The following NoSQL databases are supported: Name Description MongoDB MongoDB is a scalab

Mvc\Model\Criteria::execute

public execute () Executes a find using the parameters built with the criteria

Assets\Resource::getPath

public getPath ()

Mvc\View::pick

public pick (mixed $renderView) Choose a different view to render instead of last-controller/last-action use Phalcon\Mvc\Controller; class ProductsController extends Controller { public function saveAction() { // Do some save stuff... // Then show the list view $this->view->pick("products/list"); } }

Session\Adapter\Redis::SESSION_DISABLED

integer SESSION_DISABLED

Db\ColumnInterface::getDefault

abstract public getDefault () ...

Flash::setAutomaticHtml

public setAutomaticHtml (mixed $automaticHtml) Set if the output must be implicitly formatted with HTML

Mvc\ModelInterface::getSource

abstract public getSource () ...

Validating Models

Validating Data Integrity Phalcon\Mvc\Model provides several events to validate data and implement business rules. The special “validation” event allows us to call built-in validators over the record. Phalcon exposes a few built-in validators that can be used at this stage of validation. The following example shows how to use it: namespace Store\Toys; use Phalcon\Mvc\Model; use Phalcon\Validation; use Phalcon\Validation\Validator\Uniqueness; use Phalcon\Validation\Validator\InclusionIn; class

Crypt::encrypt

public encrypt (mixed $text, [mixed $key]) Encrypts a text $encrypted = $crypt->encrypt("Ultra-secret text", "encrypt password");