mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-27 12:18:54 +02:00
Use imports instead of FQNs
This commit is contained in:
parent
f63b6d7207
commit
5629215ce4
179 changed files with 792 additions and 597 deletions
|
@ -41,6 +41,8 @@ declare(strict_types=1);
|
|||
|
||||
namespace App\Twig;
|
||||
|
||||
use App\Entity\Base\AbstractDBElement;
|
||||
use App\Entity\UserSystem\User;
|
||||
use App\Entity\LogSystem\AbstractLogEntry;
|
||||
use App\Repository\LogEntryRepository;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
|
@ -68,9 +70,9 @@ final class UserExtension extends AbstractExtension
|
|||
{
|
||||
return [
|
||||
/* Returns the user which has edited the given entity the last time. */
|
||||
new TwigFunction('last_editing_user', fn(\App\Entity\Base\AbstractDBElement $element): ?\App\Entity\UserSystem\User => $this->repo->getLastEditingUser($element)),
|
||||
new TwigFunction('last_editing_user', fn(AbstractDBElement $element): ?User => $this->repo->getLastEditingUser($element)),
|
||||
/* Returns the user which has created the given entity. */
|
||||
new TwigFunction('creating_user', fn(\App\Entity\Base\AbstractDBElement $element): ?\App\Entity\UserSystem\User => $this->repo->getCreatingUser($element)),
|
||||
new TwigFunction('creating_user', fn(AbstractDBElement $element): ?User => $this->repo->getCreatingUser($element)),
|
||||
];
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue