| @@ 169-181 (lines=13) @@ | ||
| 166 | * |
|
| 167 | * @return array Collection of entity identifiers ordered by additional field value |
|
| 168 | */ |
|
| 169 | protected function applySorting(array $entityIDs, $fieldName, $order = 'ASC') |
|
| 170 | { |
|
| 171 | if (array_key_exists($fieldName, self::$fieldIDs)) { |
|
| 172 | // Order by parent fields |
|
| 173 | return $this->query |
|
| 174 | ->entity(static::$identifier) |
|
| 175 | ->where(static::$primaryFieldName, $entityIDs) |
|
| 176 | ->orderBy($fieldName, $order) |
|
| 177 | ->fields(static::$primaryFieldName); |
|
| 178 | } else { // Nothing is changed |
|
| 179 | return $entityIDs; |
|
| 180 | } |
|
| 181 | } |
|
| 182 | } |
|
| 183 | ||
| @@ 297-309 (lines=13) @@ | ||
| 294 | * |
|
| 295 | * @return array Collection of entity identifiers ordered by additional field value |
|
| 296 | */ |
|
| 297 | protected function applySorting(array $entityIDs, $fieldName, $order = 'ASC') |
|
| 298 | { |
|
| 299 | if (array_key_exists($fieldName, static::$fieldIDs)) { |
|
| 300 | // Order by parent fields |
|
| 301 | return $this->query |
|
| 302 | ->entity(static::$identifier) |
|
| 303 | ->where(static::$primaryFieldName, $entityIDs) |
|
| 304 | ->orderBy($fieldName, $order) |
|
| 305 | ->fields(static::$primaryFieldName); |
|
| 306 | } else { // Nothing is changed |
|
| 307 | return $entityIDs; |
|
| 308 | } |
|
| 309 | } |
|
| 310 | } |
|
| 311 | ||