2022-01-02 20:04:52 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types = 1);
|
|
|
|
|
|
|
|
namespace Component\Collection\Util\Controller;
|
|
|
|
|
|
|
|
use App\Core\Controller;
|
2022-01-03 20:37:22 +00:00
|
|
|
use App\Entity\Actor;
|
|
|
|
use App\Util\Common;
|
2022-01-02 23:59:23 +00:00
|
|
|
use Component\Feed\Feed;
|
2022-01-02 20:04:52 +00:00
|
|
|
|
|
|
|
class Collection extends Controller
|
|
|
|
{
|
2022-01-04 21:58:49 +00:00
|
|
|
public function query(string $query, ?string $locale = null, ?Actor $actor = null)
|
2022-01-02 23:59:23 +00:00
|
|
|
{
|
2022-01-04 21:58:49 +00:00
|
|
|
$actor ??= Common::actor();
|
|
|
|
$locale ??= Common::currentLanguage()->getLocale();
|
|
|
|
return Feed::query($query, $this->int('page') ?? 1, $locale, $actor);
|
2022-01-02 23:59:23 +00:00
|
|
|
}
|
2022-01-02 20:04:52 +00:00
|
|
|
}
|