mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-01-21 17:49:34 +00:00
Fixed some inspection issues
This commit is contained in:
parent
33475dca66
commit
42e604245c
85 changed files with 272 additions and 291 deletions
|
|
@ -45,12 +45,12 @@ use Symfony\Component\Validator\Constraints as Assert;
|
|||
*/
|
||||
#[ORM\Entity]
|
||||
#[ORM\Table('`groups`')]
|
||||
#[ORM\Index(name: 'group_idx_name', columns: ['name'])]
|
||||
#[ORM\Index(name: 'group_idx_parent_name', columns: ['parent_id', 'name'])]
|
||||
#[NoLockout()]
|
||||
#[ORM\Index(columns: ['name'], name: 'group_idx_name')]
|
||||
#[ORM\Index(columns: ['parent_id', 'name'], name: 'group_idx_parent_name')]
|
||||
#[NoLockout]
|
||||
class Group extends AbstractStructuralDBElement implements HasPermissionsInterface
|
||||
{
|
||||
#[ORM\OneToMany(targetEntity: self::class, mappedBy: 'parent')]
|
||||
#[ORM\OneToMany(mappedBy: 'parent', targetEntity: self::class)]
|
||||
#[ORM\OrderBy(['name' => 'ASC'])]
|
||||
protected Collection $children;
|
||||
|
||||
|
|
@ -61,21 +61,21 @@ class Group extends AbstractStructuralDBElement implements HasPermissionsInterfa
|
|||
/**
|
||||
* @var Collection<int, User>
|
||||
*/
|
||||
#[ORM\OneToMany(targetEntity: User::class, mappedBy: 'group')]
|
||||
#[ORM\OneToMany(mappedBy: 'group', targetEntity: User::class)]
|
||||
protected Collection $users;
|
||||
|
||||
/**
|
||||
* @var bool If true all users associated with this group must have enabled some kind of two-factor authentication
|
||||
*/
|
||||
#[Groups(['extended', 'full', 'import'])]
|
||||
#[ORM\Column(type: Types::BOOLEAN, name: 'enforce_2fa')]
|
||||
#[ORM\Column(name: 'enforce_2fa', type: Types::BOOLEAN)]
|
||||
protected bool $enforce2FA = false;
|
||||
|
||||
/**
|
||||
* @var Collection<int, GroupAttachment>
|
||||
*/
|
||||
#[Assert\Valid]
|
||||
#[ORM\OneToMany(targetEntity: GroupAttachment::class, mappedBy: 'element', cascade: ['persist', 'remove'], orphanRemoval: true)]
|
||||
#[ORM\OneToMany(mappedBy: 'element', targetEntity: GroupAttachment::class, cascade: ['persist', 'remove'], orphanRemoval: true)]
|
||||
#[ORM\OrderBy(['name' => 'ASC'])]
|
||||
protected Collection $attachments;
|
||||
|
||||
|
|
@ -85,14 +85,14 @@ class Group extends AbstractStructuralDBElement implements HasPermissionsInterfa
|
|||
|
||||
#[Groups(['full'])]
|
||||
#[ORM\Embedded(class: PermissionData::class, columnPrefix: 'permissions_')]
|
||||
#[ValidPermission()]
|
||||
#[ValidPermission]
|
||||
protected ?PermissionData $permissions = null;
|
||||
|
||||
/**
|
||||
* @var Collection<int, GroupParameter>
|
||||
*/
|
||||
#[Assert\Valid]
|
||||
#[ORM\OneToMany(targetEntity: GroupParameter::class, mappedBy: 'element', cascade: ['persist', 'remove'], orphanRemoval: true)]
|
||||
#[ORM\OneToMany(mappedBy: 'element', targetEntity: GroupParameter::class, cascade: ['persist', 'remove'], orphanRemoval: true)]
|
||||
#[ORM\OrderBy(['group' => 'ASC', 'name' => 'ASC'])]
|
||||
protected Collection $parameters;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue