Pārlūkot izejas kodu

Correctif SectionStore / ProductFamilySolver

packProduct
Guillaume pirms 3 gadiem
vecāks
revīzija
3a54254d4c
3 mainītis faili ar 22 papildinājumiem un 3 dzēšanām
  1. +6
    -3
      Repository/Section/SectionRepositoryQuery.php
  2. +7
    -0
      Repository/Section/SectionStore.php
  3. +9
    -0
      Solver/Product/ProductFamilySolver.php

+ 6
- 3
Repository/Section/SectionRepositoryQuery.php Parādīt failu

@@ -17,9 +17,12 @@ class SectionRepositoryQuery extends AbstractRepositoryQuery

public function filterByIsDefault(bool $isDefault)
{
return $this
->andWhere('.isDefault = :isDefault')
->setParameter('isDefault', $isDefault);
return $this->andWhereEqual('isDefault', $isDefault);
}

public function filterByIsCommon(bool $isCommon)
{
return $this->andWhereEqual('isCommon', $isCommon);
}

}

+ 7
- 0
Repository/Section/SectionStore.php Parādīt failu

@@ -63,4 +63,11 @@ class SectionStore extends AbstractStore
// @TODO : à implémenter avec le nouveau système d'ouverture des commandes
}

public function getOnlineWithoutCommon($query = null)
{
$query = $this->createDefaultQuery($query);
$query->filterByIsCommon(false);
return $query->find();
}

}

+ 9
- 0
Solver/Product/ProductFamilySolver.php Parādīt failu

@@ -21,6 +21,15 @@ class ProductFamilySolver
$this->productSolver = $productSolver;
}

public function countProductFamiliesOrganizedByParentCategory(array $categories): int
{
$count = 0;
foreach ($categories as $category) {
$count += count($category['products']);
}
return $count;
}

public function getAvailableQuantityInherited(ProductFamilyInterface $productFamily)
{
$availableQuantity = 0;

Notiek ielāde…
Atcelt
Saglabāt