Explorar el Código

ProductFamilyStore : ajout getOneByTitle()

develop
Guillaume Bourgeois hace 1 año
padre
commit
6d69708fa7
Se han modificado 2 ficheros con 10 adiciones y 0 borrados
  1. +4
    -0
      Repository/Product/ProductFamilyRepositoryQuery.php
  2. +6
    -0
      Repository/Product/ProductFamilyStore.php

+ 4
- 0
Repository/Product/ProductFamilyRepositoryQuery.php Ver fichero

@@ -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 Ver fichero

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

Cargando…
Cancelar
Guardar