add similar posts

This commit is contained in:
Simon Vieille 2022-09-09 20:10:51 +02:00
commit f33e16b198
Signed by: deblan
GPG key ID: 579388D585F70417
8 changed files with 128 additions and 8 deletions

View file

@ -18,7 +18,7 @@ class PostRepositoryQuery extends RepositoryQuery
parent::__construct($repository, 'p', $paginator);
}
public function inCategory(Category $category, bool $strict = true)
public function inCategory(Category $category, bool $strict = true): self
{
$c = 'c'.mt_rand();
@ -45,7 +45,7 @@ class PostRepositoryQuery extends RepositoryQuery
return $this;
}
public function published()
public function published(): self
{
return $this
->andWhere('.status = 1')