Use natural sorting for trees and others repository functions

This commit is contained in:
Jan Böhmer 2024-06-17 22:33:40 +02:00
parent 9db822eabd
commit 8bb8118d9f
13 changed files with 71 additions and 44 deletions

View file

@ -28,13 +28,13 @@ use InvalidArgumentException;
class MeasurementUnitRepository extends AbstractPartsContainingRepository
{
public function getParts(object $element, array $order_by = ['name' => 'ASC']): array
public function getParts(object $element, string $nameOrderDirection = "ASC"): array
{
if (!$element instanceof MeasurementUnit) {
throw new InvalidArgumentException('$element must be an MeasurementUnit!');
}
return $this->getPartsByField($element, $order_by, 'partUnit');
return $this->getPartsByField($element, $nameOrderDirection, 'partUnit');
}
public function getPartsCount(object $element): int