[PLUGINS][RelatedTags] Add related tags plugin and needed infrastructure. Initial work on pinned content

This commit is contained in:
2021-11-28 18:58:56 +00:00
committed by Diogo Peralta Cordeiro
parent 3227018963
commit 3477ad5efc
11 changed files with 117 additions and 5 deletions

View File

@@ -22,6 +22,7 @@ declare(strict_types = 1);
namespace App\Entity;
use App\Core\Entity;
use App\Core\Router\Router;
use Component\Tag\Tag;
use DateTimeInterface;
@@ -95,6 +96,15 @@ class NoteTag extends Entity
// @codeCoverageIgnoreEnd
// }}} Autocode
public function getUrl(?Actor $actor = null): string
{
$params = ['tag' => $this->getCanonical()];
if (!\is_null($actor)) {
$params['lang'] = $actor->getTopLanguage()->getLocale();
}
return Router::url('single_note_tag', $params);
}
public static function schemaDef(): array
{
return [