vendor/pimcore/pimcore/bundles/AdminBundle/Controller/AdminAbstractController.php line 36

Open in your IDE?
  1. <?php
  2. /**
  3.  * Pimcore
  4.  *
  5.  * This source file is available under two different licenses:
  6.  * - GNU General Public License version 3 (GPLv3)
  7.  * - Pimcore Commercial License (PCL)
  8.  * Full copyright and license information is available in
  9.  * LICENSE.md which is distributed with this source code.
  10.  *
  11.  *  @copyright  Copyright (c) Pimcore GmbH (http://www.pimcore.org)
  12.  *  @license    http://www.pimcore.org/license     GPLv3 and PCL
  13.  */
  14. namespace Pimcore\Bundle\AdminBundle\Controller;
  15. use Pimcore\Controller\Traits\JsonHelperTrait;
  16. use Pimcore\Controller\UserAwareController;
  17. use Pimcore\Model\User;
  18. use Pimcore\Security\User\User as UserProxy;
  19. use Symfony\Component\HttpFoundation\JsonResponse;
  20. /**
  21.  * @internal
  22.  */
  23. abstract class AdminAbstractController extends UserAwareController
  24. {
  25.     use JsonHelperTrait;
  26.     /**
  27.      * Returns a JsonResponse that uses the admin serializer
  28.      */
  29.     protected function adminJson(mixed $data, int $status = 200, array $headers = [], array $context = [], bool $useAdminSerializer = true): JsonResponse
  30.     {
  31.         return $this->jsonResponse($data, $status, $headers, $context, $useAdminSerializer);
  32.     }
  33.     /**
  34.      * Get user from user proxy object which is registered on security component
  35.      */
  36.     protected function getAdminUser(bool $proxyUser = false): UserProxy|User|null
  37.     {
  38.         return $this->getPimcoreUser($proxyUser);
  39.     }
  40. }