public function testCacheLocal() { $source = new CM_PagingSource_Sql('`num`', 'test'); $source->enableCacheLocal(); $this->assertEquals(100, $source->getCount()); CM_Db_Db::delete('test', array('num' => 0)); $this->assertEquals(100, $source->getCount()); $source->clearCache(); $this->assertEquals(99, $source->getCount()); CM_Cache_Local::getInstance()->flush(); }
/** * @param int $type OPTIONAL */ public function __construct($type = null) { $where = null; if ($type) { $type = (int) $type; $where = '`type` = ' . $type; } $source = new CM_PagingSource_Sql('DISTINCT `actionType`, `actionVerb`, `type`', 'cm_actionLimit', $where, '`type`, `actionType`, `actionVerb`'); $source->enableCacheLocal(); parent::__construct($source); }
/** * @param CM_Action_Abstract $action */ public function __construct(CM_Action_Abstract $action) { $source = new CM_PagingSource_Sql('DISTINCT `actionType`, `actionVerb`, `type`', 'cm_actionLimit', '`actionType` = ' . $action->getType() . ' AND `actionVerb` = ' . $action->getVerb(), '`type`'); $source->enableCacheLocal(); parent::__construct($source); }
public function __construct() { $source = new CM_PagingSource_Sql('`ip`', 'cm_ipBlocked'); $source->enableCacheLocal(60); parent::__construct($source); }
/** * @param CM_Model_Splittest $splittest */ public function __construct(CM_Model_Splittest $splittest) { $source = new CM_PagingSource_Sql('id', 'cm_splittestVariation', '`splittestId`=' . $splittest->getId()); $source->enableCacheLocal(86400); parent::__construct($source); }
public function __construct() { $source = new CM_PagingSource_Sql('id, abbreviation', 'cm_model_language', 'enabled = 1', 'name ASC'); $source->enableCacheLocal(); parent::__construct($source); }
public function __construct() { $source = new CM_PagingSource_Sql('userId', 'cm_user_online'); $source->enableCacheLocal(1); parent::__construct($source); }
public function __construct() { $source = new CM_PagingSource_Sql('name', 'cm_splitfeature'); $source->enableCacheLocal(); parent::__construct($source); }
public function __construct() { $source = new CM_PagingSource_Sql('name', 'cm_splittest', null, 'createStamp'); $source->enableCacheLocal(); parent::__construct($source); }