Version 5.0.6
This commit is contained in:
1 parent
a3a4a9ccbd
commit
b89858b2ff
1214 files changed
+92828
-14859
No files matched your search
@@ -472,12 +472,13 @@ class Feature extends ActiveRecord
|
||||
/**
|
||||
* Promote stream of internally promoted items
|
||||
*
|
||||
* @param int|array $limit Number of items to fetch
|
||||
* @param string $sortField Sort by field
|
||||
* @param string $sortDirection Sort by direction (asc, desc)
|
||||
* @param int|array $limit Number of items to fetch
|
||||
* @param string $sortField Sort by field
|
||||
* @param string $sortDirection Sort by direction (asc, desc)
|
||||
* @param DateTime|null $oldestDate
|
||||
* @return array
|
||||
*/
|
||||
public static function internalStream( int|array $limit=10, string $sortField='promote_added', string $sortDirection='desc') : array
|
||||
public static function internalStream( int|array $limit=10, string $sortField='promote_added', string $sortDirection='desc', ?DateTime $oldestDate=null ) : array
|
||||
{
|
||||
$_key = md5( $limit . $sortField . $sortDirection );
|
||||
|
||||
@@ -487,8 +488,14 @@ class Feature extends ActiveRecord
|
||||
}
|
||||
|
||||
$items = array();
|
||||
|
||||
foreach( Db::i()->select( '*', static::$databaseTable, array( 'promote_hide=0' ), $sortField . ' ' . $sortDirection, $limit ) as $row )
|
||||
$where = [ [ 'promote_hide=0' ] ];
|
||||
|
||||
if ( $oldestDate )
|
||||
{
|
||||
$where[] = [ 'promote_added > ?', $oldestDate->getTimestamp() ];
|
||||
}
|
||||
|
||||
foreach( Db::i()->select( '*', static::$databaseTable, $where, $sortField . ' ' . $sortDirection, $limit ) as $row )
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user