mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-27 06:14:45 +02:00
Use natural sorting for trees and others repository functions
This commit is contained in:
parent
9db822eabd
commit
8bb8118d9f
13 changed files with 71 additions and 44 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue