예제 #1
0
파일: All.php 프로젝트: cargomedia/cm
 /**
  * @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);
 }
예제 #2
0
 public function testCache()
 {
     $source = new CM_PagingSource_Sql('`num`', 'test');
     $source->enableCache();
     $this->assertSame(100, $source->getCount());
     $sourceNocache = new CM_PagingSource_Sql('`num`', 'test');
     $this->assertSame(100, $sourceNocache->getCount());
     CM_Db_Db::delete('test', array('num' => 0));
     $this->assertSame(100, $source->getCount());
     $this->assertSame(99, $sourceNocache->getCount());
     $source->clearCache();
     $this->assertSame(99, $source->getCount());
     $this->assertSame(99, $sourceNocache->getCount());
     CM_Cache_Shared::getInstance()->flush();
 }
예제 #3
0
 public function testCacheCustom()
 {
     $source = new CM_PagingSource_Sql('`num`', 'test');
     $fileCache = CM_Cache_Persistent::getInstance();
     $source->enableCache(null, $fileCache);
     $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_Db_Db::delete('test', array('num' => 1));
     $this->assertEquals(99, $source->getCount());
     $fileCache->flush();
     $this->assertEquals(98, $source->getCount());
 }
예제 #4
0
파일: All.php 프로젝트: cargomedia/cm
 public function __construct()
 {
     $source = new CM_PagingSource_Sql('id, abbreviation', 'cm_model_language');
     $source->enableCache();
     parent::__construct($source);
 }
예제 #5
0
 public function __construct(CM_Model_StreamChannel_Abstract $streamChannel)
 {
     $source = new CM_PagingSource_Sql('DISTINCT `userId`', 'cm_stream_publish', '`channelId` = ' . $streamChannel->getId());
     $source->enableCache();
     parent::__construct($source);
 }
예제 #6
0
파일: Action.php 프로젝트: cargomedia/cm
 /**
  * @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);
 }
예제 #7
0
파일: Blocked.php 프로젝트: cargomedia/cm
 public function __construct()
 {
     $source = new CM_PagingSource_Sql('`ip`', 'cm_ipBlocked');
     $source->enableCacheLocal(60);
     parent::__construct($source);
 }
예제 #8
0
파일: Splittest.php 프로젝트: cargomedia/cm
 /**
  * @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);
 }
예제 #9
0
파일: All.php 프로젝트: cargomedia/cm
 public function __construct()
 {
     $source = new CM_PagingSource_Sql('id', 'cm_model_currency', null, 'id');
     $source->enableCache();
     parent::__construct($source);
 }
예제 #10
0
파일: Channel.php 프로젝트: cargomedia/cm
 /**
  * @param int $channelId $streamChannelArchive
  */
 public function __construct($channelId)
 {
     $source = new CM_PagingSource_Sql('id', 'cm_streamchannel_thumbnail', 'channelId = ?', 'createStamp', null, null, [(int) $channelId]);
     $source->enableCache();
     parent::__construct($source);
 }
예제 #11
0
파일: Online.php 프로젝트: cargomedia/cm
 public function __construct()
 {
     $source = new CM_PagingSource_Sql('userId', 'cm_user_online');
     $source->enableCacheLocal(1);
     parent::__construct($source);
 }
예제 #12
0
파일: All.php 프로젝트: cargomedia/cm
 public function __construct()
 {
     $source = new CM_PagingSource_Sql('name', 'cm_splitfeature');
     $source->enableCacheLocal();
     parent::__construct($source);
 }
예제 #13
0
파일: All.php 프로젝트: cargomedia/cm
 public function __construct()
 {
     $source = new CM_PagingSource_Sql('name', 'cm_splittest', null, 'createStamp');
     $source->enableCacheLocal();
     parent::__construct($source);
 }
예제 #14
0
 /**
  * @param CM_Model_StreamChannel_Abstract $streamChannel
  */
 public function __construct(CM_Model_StreamChannel_Abstract $streamChannel)
 {
     $source = new CM_PagingSource_Sql('`id`', 'cm_stream_subscribe', '`channelId` = ' . $streamChannel->getId());
     $source->enableCache();
     return parent::__construct($source);
 }