| @@ 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 | ||
| @@ 263-275 (lines=13) @@ | ||
| 260 | * | |
| 261 | * @return array Collection of entity identifiers ordered by additional field value | |
| 262 | */ | |
| 263 | protected function applySorting(array $entityIDs, $fieldName, $order = 'ASC') | |
| 264 |     { | |
| 265 |         if (array_key_exists($fieldName, static::$fieldIDs)) { | |
| 266 | // Order by parent fields | |
| 267 | return $this->query | |
| 268 | ->entity(static::$identifier) | |
| 269 | ->where(static::$primaryFieldName, $entityIDs) | |
| 270 | ->orderBy($fieldName, $order) | |
| 271 | ->fields(static::$primaryFieldName); | |
| 272 |         } else { // Nothing is changed | |
| 273 | return $entityIDs; | |
| 274 | } | |
| 275 | } | |
| 276 | } | |
| 277 | ||