Exemplo n.º 1
0
 /**
  * @param string                          $key
  * @param CM_Model_StreamChannel_Abstract $channel
  * @return CM_Model_Stream_Publish|null
  */
 public static function findByKeyAndChannel($key, CM_Model_StreamChannel_Abstract $channel)
 {
     $id = CM_Db_Db::select('cm_stream_publish', 'id', array('key' => (string) $key, 'channelId' => $channel->getId()))->fetchColumn();
     if (!$id) {
         return null;
     }
     return new static($id);
 }
Exemplo n.º 2
0
 /**
  * @param CM_Model_StreamChannel_Abstract $streamChannel
  * @return boolean
  */
 public function contains(CM_Model_StreamChannel_Abstract $streamChannel)
 {
     return in_array(array('id' => $streamChannel->getId(), 'type' => $streamChannel->getType()), $this->getItemsRaw());
 }
Exemplo n.º 3
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);
 }
Exemplo n.º 4
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);
 }