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