/** * @param int $type * @param int|null $createStampMax */ public function __construct($type, $createStampMax = null) { $type = (int) $type; $where = '`streamChannelType` = ' . $type; if (!is_null($createStampMax)) { $createStampMax = (int) $createStampMax; $where .= ' AND `createStamp` <= ' . $createStampMax; } $source = new CM_PagingSource_Sql('id', 'cm_streamChannelArchive_media', $where, 'createStamp DESC'); parent::__construct($source); }
public function __construct() { $source = new CM_PagingSource_Sql('id', 'cm_streamChannelArchive_media', null, 'createStamp DESC'); parent::__construct($source); }
/** * @param string $key */ public function __construct($key) { $source = new CM_PagingSource_Sql('id', 'cm_streamChannelArchive_media', '`key` = ?', 'createStamp', null, null, [(string) $key]); parent::__construct($source); }