Skip to content

Instantly share code, notes, and snippets.

<?php
class NewsController extends \Phalcon\Mvc\Controller
{
public function indexAction()
{
}
<?php
class Account {
public function save($data=null)
{
$entity = new Entity();
$entity->name = 'Account';
$this->entity = $entity;
return parent::save($data);
<?php return Phalcon\Annotations\Reflection::__set_state(array(
'_reflectionData' =>
array (
'class' =>
array (
0 =>
array (
'type' => 300,
'name' => 'Simple',
'file' => '/home/gutierrezandresfelipe/cphalcon/unit-tests/annotations/TestClass.php',
<?php
/**
* TestClass
*
* This is a test class, it's useful to make tests
*
* @Simple
* @SingleParam("Param")
* @MultipleParams("First", Second, 1, 1.1, -10, false, true, null)
<?php
$di = new Phalcon\DI();
$di['router'] = function(){
$router = new Phalcon\Mvc\Router(false);
$router->add('/', array(
'module' => "frontend",
<?php
class CacheModel extends Phalcon\Mvc\Model
{
static protected $_cacheKey;
static protected $_cacheLifetime = 3600;
public static function getCacheKey($parameters)
<?php
use Phalcon\Mvc\Model\Transaction\Manager as TxManager;
use Phalcon\Mvc\Model\Transaction\Failed as TxFailed;
$di = new Phalcon\DI\FactoryDefault();
$eventsManager = $di['eventsManager'];
$eventsManager->attach('db', function($event, $connection){
<?php
class Category extends Phalcon\Mvc\Model
{
public $id;
public $lft;
public $rgt;
<?php
class RobotsController extends Phalcon\Mvc\Controller
{
public function index()
{
echo "Hello Index";
}
public function show($id)
<?php
class Robots extends Phalcon\Mvc\Model
{
public function initialize()
{
$this->keepSnapshot(true);
}
}