@@ -201,4 +201,8 @@ class ProductFamilyRepositoryQuery extends AbstractRepositoryQuery | |||
return $this; | |||
} | |||
public function filterByTitle(string $title): self | |||
{ | |||
return $this->andWhere('.title LIKE :title')->setParameter('title', $title); | |||
} | |||
} |
@@ -361,4 +361,10 @@ class ProductFamilyStore extends AbstractStore | |||
return $productFamiliesToReturn; | |||
} | |||
public function getOneByTitle(string $title): ?ProductFamilyInterface | |||
{ | |||
$query = $this->createDefaultQuery(); | |||
$query->filterByTitle($title); | |||
return $query->findOne(); | |||
} | |||
} |