Change variable name to make it more explicit.

This commit is contained in:
Benoît Burnichon
2016-03-02 14:40:46 +01:00
parent 1a9035c60f
commit 6b7e28e2bd
3 changed files with 8 additions and 12 deletions

View File

@@ -90,13 +90,9 @@ class ArrayCacheCollectionReferenceRepository implements CollectionReferenceRepo
return null; return null;
} }
/** public function findHavingOrderMaster(array $baseIdsSubset = null)
* @param array|null $subset
* @return CollectionReference[]
*/
public function findHavingOrderMaster(array $subset = null)
{ {
return $this->repository->findHavingOrderMaster($subset); return $this->repository->findHavingOrderMaster($baseIdsSubset);
} }
/** /**

View File

@@ -39,10 +39,10 @@ interface CollectionReferenceRepository
/** /**
* Find Collection references having at least one Order Master * Find Collection references having at least one Order Master
* *
* @param array<int>|null $subset Restrict search to a subset of base ids. * @param array<int>|null $baseIdsSubset Restrict search to a subset of base ids.
* @return CollectionReference[] * @return CollectionReference[]
*/ */
public function findHavingOrderMaster(array $subset = null); public function findHavingOrderMaster(array $baseIdsSubset = null);
/** /**
* @param CollectionReference $reference * @param CollectionReference $reference

View File

@@ -112,7 +112,7 @@ WHERE base_id = :baseId';
return null; return null;
} }
public function findHavingOrderMaster(array $subset = null) public function findHavingOrderMaster(array $baseIdsSubset = null)
{ {
$query = self::$selectQuery $query = self::$selectQuery
. ' WHERE EXISTS(SELECT 1 FROM basusr WHERE basusr.order_master = 1 AND basusr.base_id = bas.base_id)'; . ' WHERE EXISTS(SELECT 1 FROM basusr WHERE basusr.order_master = 1 AND basusr.base_id = bas.base_id)';
@@ -120,13 +120,13 @@ WHERE base_id = :baseId';
$parameters = []; $parameters = [];
$types = []; $types = [];
if (null !== $subset) { if (null !== $baseIdsSubset) {
if (empty($subset)) { if (empty($baseIdsSubset)) {
return []; return [];
} }
$query .= ' AND bas.base_id IN (:subset)'; $query .= ' AND bas.base_id IN (:subset)';
$parameters['subset'] = $subset; $parameters['subset'] = $baseIdsSubset;
$types['subset'] = Connection::PARAM_INT_ARRAY; $types['subset'] = Connection::PARAM_INT_ARRAY;
} }