wip: extend model, admin crud
This commit is contained in:
1 parent
3ae30899ea
commit
a294d1cc5e
38 files changed
+1240
-830
No files matched your search
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Controller\Traits;
|
||||
|
||||
use App\Entity\Groups\SortableEntityInterface;
|
||||
|
||||
trait SortingControllerTrait
|
||||
{
|
||||
private function applySorting(iterable $collection, array $sortingMap): void
|
||||
{
|
||||
foreach ($collection as $entity) {
|
||||
/** @var SortableEntityInterface $entity */
|
||||
if (isset($sortingMap[$entity->getId()])) {
|
||||
$entity->setSorting((int) $sortingMap[$entity->getId()]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user