Przeglądaj źródła

ProductFamilyStore : ajout getOneByTitle()

develop
Guillaume Bourgeois 1 rok temu
rodzic
commit
6d69708fa7
2 zmienionych plików z 10 dodań i 0 usunięć
  1. +4
    -0
      Repository/Product/ProductFamilyRepositoryQuery.php
  2. +6
    -0
      Repository/Product/ProductFamilyStore.php

+ 4
- 0
Repository/Product/ProductFamilyRepositoryQuery.php Wyświetl plik

@@ -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 Wyświetl plik

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

Ładowanie…
Anuluj
Zapisz