mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 13:24:25 +00:00
Merge branch '677-order-social-actions' into testing
This commit is contained in:
commit
7e06d7beed
@ -13,7 +13,9 @@ namespace Chill\PersonBundle\Controller;
|
|||||||
|
|
||||||
use Chill\MainBundle\CRUD\Controller\ApiController;
|
use Chill\MainBundle\CRUD\Controller\ApiController;
|
||||||
use Chill\MainBundle\Pagination\PaginatorFactory;
|
use Chill\MainBundle\Pagination\PaginatorFactory;
|
||||||
|
use Chill\MainBundle\Pagination\PaginatorInterface;
|
||||||
use Chill\MainBundle\Serializer\Model\Collection;
|
use Chill\MainBundle\Serializer\Model\Collection;
|
||||||
|
use Chill\PersonBundle\Entity\SocialWork\SocialAction;
|
||||||
use Chill\PersonBundle\Repository\SocialWork\SocialIssueRepository;
|
use Chill\PersonBundle\Repository\SocialWork\SocialIssueRepository;
|
||||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
@ -41,7 +43,12 @@ class SocialWorkSocialActionApiController extends ApiController
|
|||||||
throw $this->createNotFoundException('socialIssue not found');
|
throw $this->createNotFoundException('socialIssue not found');
|
||||||
}
|
}
|
||||||
|
|
||||||
$socialActions = $socialIssue->getRecursiveSocialActions();
|
$socialActions = $socialIssue->getRecursiveSocialActions()->toArray();
|
||||||
|
|
||||||
|
usort($socialActions, function (SocialAction $sa, SocialAction $sb) {
|
||||||
|
return $sa->getOrdering() <=> $sb->getOrdering();
|
||||||
|
});
|
||||||
|
|
||||||
$pagination = $this->paginator->create(count($socialActions));
|
$pagination = $this->paginator->create(count($socialActions));
|
||||||
// max one page
|
// max one page
|
||||||
$pagination->setItemsPerPage(count($socialActions));
|
$pagination->setItemsPerPage(count($socialActions));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user