/** * @param integer $n * @return array */ public static function findLastN($n) { /** @var DB $db */ $db = DB::instance(); $sql = sprintf('SELECT * FROM ' . self::TABLE . ' ORDER BY id DESC LIMIT %d', $n); $res = $db->query($sql, self::class); return $res; }
public static function findLastNews($limit) { $db = DB::instance(); return $db->query('SELECT * FROM ' . static::TABLE . ' ORDER BY id DESC LIMIT ' . $limit, static::class); }