Refactor OrderController

This commit is contained in:
Benoît Burnichon
2016-02-25 19:40:46 +01:00
parent 2b5557ac7c
commit cb87d7c0f1
3 changed files with 80 additions and 64 deletions

View File

@@ -64,7 +64,7 @@ class RecordsRequest extends ArrayCollection
$i = 0;
$records = $this->toArray();
array_walk($records, function ($record) use (&$i) {
array_walk($records, function (\record_adapter $record) use (&$i) {
$record->setNumber($i++);
});
}
@@ -103,8 +103,8 @@ class RecordsRequest extends ArrayCollection
/** @var \record_adapter $record */
foreach ($this as $record) {
if (false === array_key_exists($record->get_base_id(), $this->collections)) {
$this->collections[$record->get_base_id()] = $record->get_collection();
if (! isset($this->collections[$record->getBaseId()])) {
$this->collections[$record->getBaseId()] = $record->get_collection();
}
}