Bläddra i källkod

ProductFamilyStore : ajout getOneByTitle()

develop
Guillaume Bourgeois 1 år sedan
förälder
incheckning
6d69708fa7
2 ändrade filer med 10 tillägg och 0 borttagningar
  1. +4
    -0
      Repository/Product/ProductFamilyRepositoryQuery.php
  2. +6
    -0
      Repository/Product/ProductFamilyStore.php

+ 4
- 0
Repository/Product/ProductFamilyRepositoryQuery.php Visa fil

@@ -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);
}
}

+ 6
- 0
Repository/Product/ProductFamilyStore.php Visa fil

@@ -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();
}
}

Laddar…
Avbryt
Spara