diff --git a/DataStorage/Database/Mapper/DataMapperAbstract.php b/DataStorage/Database/Mapper/DataMapperAbstract.php index 7ad1f18ed..a884a17f8 100644 --- a/DataStorage/Database/Mapper/DataMapperAbstract.php +++ b/DataStorage/Database/Mapper/DataMapperAbstract.php @@ -285,7 +285,8 @@ abstract class DataMapperAbstract if (isset($this->sort[$member])) { foreach ($this->sort[$member] as $sort) { - if ($sort['child'] === '') { + // member = child element in this case + if ($member === '') { continue; } @@ -305,7 +306,8 @@ abstract class DataMapperAbstract if (isset($this->limit[$member])) { foreach ($this->limit[$member] as $limit) { - if ($limit['child'] === '') { + // member = child element in this case + if ($member === '') { continue; } diff --git a/DataStorage/Database/Mapper/ReadMapper.php b/DataStorage/Database/Mapper/ReadMapper.php index c87192543..b09e5e4df 100644 --- a/DataStorage/Database/Mapper/ReadMapper.php +++ b/DataStorage/Database/Mapper/ReadMapper.php @@ -442,7 +442,7 @@ final class ReadMapper extends DataMapperAbstract continue; } - foreach ($data as $index => $with) { + foreach ($data as $with) { if ($with['child'] !== '') { continue; } @@ -485,7 +485,7 @@ final class ReadMapper extends DataMapperAbstract // handle sort, the column name order is very important. Therefore it cannot be done in the foreach loop above! foreach ($this->sort as $member => $data) { - foreach ($data as $index => $sort) { + foreach ($data as $sort) { if (($column = $this->mapper::getColumnByMember($member)) === null || ($sort['child'] !== '') ) { @@ -504,7 +504,7 @@ final class ReadMapper extends DataMapperAbstract continue; } - foreach ($data as $index => $limit) { + foreach ($data as $limit) { if ($limit['child'] === '') { $query->limit($limit['limit']);