![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/mautic.corals.io/app/bundles/DashboardBundle/Entity/ |
<?php namespace Mautic\DashboardBundle\Entity; use Mautic\CoreBundle\Entity\CommonRepository; /** * @extends CommonRepository<Widget> */ class WidgetRepository extends CommonRepository { /** * Update widget ordering. * * @param array $ordering * @param int $userId */ public function updateOrdering($ordering, $userId): void { $widgets = $this->getEntities( [ 'filter' => [ 'createdBy' => $userId, ], ] ); foreach ($widgets as &$widget) { if (isset($ordering[$widget->getId()])) { $widget->setOrdering((int) $ordering[$widget->getId()]); } } $this->saveEntities($widgets); } protected function getDefaultOrder(): array { return [ ['w.ordering', 'ASC'], ]; } public function getTableAlias(): string { return 'w'; } }