Skip to content

Commit

Permalink
Merge pull request #1921 from denis-gorin/issue-1920-fix-page-by-slug
Browse files Browse the repository at this point in the history
fix displaying page (singleton) by slug
  • Loading branch information
bobdenotter authored Sep 30, 2020
2 parents 4b19199 + ffdd742 commit 918da75
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Repository/ContentRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,12 @@ public function findOneById(int $id): ?Content
return $this->find($id);
}

public function findOneBySlug(string $slug, ?ContentType $contentType = null): ?Content
/*
* @param string|int $slug
*/
public function findOneBySlug($slug, ?ContentType $contentType = null): ?Content
{
$slug = (string) $slug;
$qb = $this->getQueryBuilder();
$connection = $qb->getEntityManager()->getConnection();

Expand Down

0 comments on commit 918da75

Please sign in to comment.