Tutorial by Examples

To use SQL syntax with model, that would transfer result to proper instantions, you should use directly one of Phalcon\Mvc\Model\Resultset classes: $users = new \Application\Models\Users(); // bitwise operation on `flag` field $sql = 'SELECT * FROM phorum.users WHERE (15 & (1 <&...
A model for a new table can be created by running the following commend from the terminal root location: phalcon model <table-name> Let us take the Model Users. SELECT There are two default functions to do select operation in phalcon, find() and findFirst() findFirst() is used to get th...
Phalcon uses db service by default to obtain connection to databases. Assuming you have an conguration file with database field set up, you can include or autoload following code to obtain connection with database for your project: $di->set('db', function () use ($config) { $dbconf = $conf...
Phalcon builds up some information about tables it is using, so it is possible to validate data being inserted to them without implementing everything by hand. Those are meta data for models. To speed up and prevent Phalcon from building Meta Data every time page is refreshed, it is possible to cach...

Page 1 of 1