Apply rector rules: add annotation for doctrine mapping

This commit is contained in:
2024-04-05 13:11:42 +02:00
parent a3f775a69b
commit 0ff4593863
118 changed files with 143 additions and 658 deletions

View File

@@ -105,8 +105,6 @@ class ExportController extends AbstractController
* This action must work with GET queries.
*
* @param string $alias
*
*
*/
#[Route(path: '/{_locale}/exports/generate/{alias}', name: 'chill_main_export_generate', methods: ['GET'])]
public function generateAction(Request $request, $alias): Response

View File

@@ -33,9 +33,6 @@ class LoginController extends AbstractController
/**
* Show a login form.
*
* @return Response
*
*/
#[\Symfony\Component\Routing\Annotation\Route(path: '/login', name: 'login')]
public function loginAction(Request $request): Response

View File

@@ -116,7 +116,6 @@ final class PasswordController extends AbstractController
/**
* @throws \Doctrine\ORM\NoResultException
* @throws \Doctrine\ORM\NonUniqueResultException
*
*/
#[Route(path: '/public/{_locale}/password/request-recover', name: 'password_request_recover')]
public function requestRecoverAction(Request $request): Response|\Symfony\Component\HttpFoundation\RedirectResponse

View File

@@ -12,7 +12,6 @@ declare(strict_types=1);
namespace Chill\MainBundle\Doctrine\Model;
use Chill\MainBundle\Entity\User;
use DateTime;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation as Serializer;
@@ -22,7 +21,6 @@ trait TrackCreationTrait
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATETIME_IMMUTABLE, nullable: true, options: ['default' => null])]
private ?\DateTimeImmutable $createdAt = null;
#[Serializer\Groups(['read'])]
#[ORM\ManyToOne(targetEntity: User::class)]
#[ORM\JoinColumn(nullable: true)]

View File

@@ -12,7 +12,6 @@ declare(strict_types=1);
namespace Chill\MainBundle\Doctrine\Model;
use Chill\MainBundle\Entity\User;
use DateTime;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation as Serializer;
@@ -22,7 +21,6 @@ trait TrackUpdateTrait
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATETIME_IMMUTABLE, nullable: true, options: ['default' => null])]
private ?\DateTimeImmutable $updatedAt = null;
#[Serializer\Groups(['read'])]
#[ORM\ManyToOne(targetEntity: User::class)]
#[ORM\JoinColumn(nullable: true)]

View File

@@ -17,7 +17,6 @@ use Chill\MainBundle\Doctrine\Model\TrackCreationTrait;
use Chill\MainBundle\Doctrine\Model\TrackUpdateInterface;
use Chill\MainBundle\Doctrine\Model\TrackUpdateTrait;
use Chill\ThirdPartyBundle\Entity\ThirdParty;
use DateTime;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
@@ -26,9 +25,6 @@ use Symfony\Component\Validator\Context\ExecutionContextInterface;
/**
* Address.
*
*
*
*/
#[ORM\Entity]
#[ORM\HasLifecycleCallbacks]
@@ -99,17 +95,12 @@ class Address implements TrackCreationInterface, TrackUpdateInterface
* @var Collection<GeographicalUnit>
*
* @readonly
*
*
*/
#[ORM\ManyToMany(targetEntity: GeographicalUnit::class)]
#[ORM\JoinTable(name: 'view_chill_main_address_geographical_unit', joinColumns: [new ORM\JoinColumn(name: 'address_id')], inverseJoinColumns: [new ORM\JoinColumn(name: 'geographical_unit_id')])]
private Collection $geographicalUnits;
/**
*
*
*
* @readonly
*/
#[Groups(['write'])]
@@ -127,11 +118,9 @@ class Address implements TrackCreationInterface, TrackUpdateInterface
/**
* A ThirdParty reference for person's addresses that are linked to a third party.
*
*
*/
#[Groups(['write'])]
#[ORM\ManyToOne(targetEntity: \Chill\ThirdPartyBundle\Entity\ThirdParty::class)]
#[ORM\ManyToOne(targetEntity: ThirdParty::class)]
#[ORM\JoinColumn(nullable: true, onDelete: 'SET NULL')]
private ?ThirdParty $linkedToThirdParty = null;
@@ -142,9 +131,8 @@ class Address implements TrackCreationInterface, TrackUpdateInterface
#[ORM\Column(type: 'point', nullable: true)]
private ?Point $point = null;
#[Groups(['write'])]
#[ORM\ManyToOne(targetEntity: \Chill\MainBundle\Entity\PostalCode::class)]
#[ORM\ManyToOne(targetEntity: PostalCode::class)]
#[ORM\JoinColumn(nullable: false)]
private ?PostalCode $postcode = null;

View File

@@ -15,7 +15,6 @@ use Chill\MainBundle\Doctrine\Model\Point;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation\Groups;
#[ORM\Entity]
#[ORM\HasLifecycleCallbacks]
#[ORM\Table(name: 'chill_main_address_reference')]
@@ -39,7 +38,6 @@ class AddressReference
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATETIME_IMMUTABLE, nullable: true)]
private ?\DateTimeImmutable $deletedAt = null;
#[Groups(['read'])]
#[ORM\Id]
#[ORM\GeneratedValue]
@@ -58,7 +56,7 @@ class AddressReference
private ?Point $point = null;
#[Groups(['read'])]
#[ORM\ManyToOne(targetEntity: \Chill\MainBundle\Entity\PostalCode::class)]
#[ORM\ManyToOne(targetEntity: PostalCode::class)]
private ?PostalCode $postcode = null;
#[Groups(['read'])]

View File

@@ -16,7 +16,6 @@ use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation as Serializer;
#[ORM\Entity]
#[ORM\Table(name: 'centers')]
class Center implements HasCenterInterface, \Stringable
@@ -24,10 +23,9 @@ class Center implements HasCenterInterface, \Stringable
/**
* @var Collection<GroupCenter>
*/
#[ORM\OneToMany(targetEntity: \Chill\MainBundle\Entity\GroupCenter::class, mappedBy: 'center')]
#[ORM\OneToMany(targetEntity: GroupCenter::class, mappedBy: 'center')]
private Collection $groupCenters;
#[Serializer\Groups(['docgen:read'])]
#[ORM\Id]
#[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)]

View File

@@ -14,7 +14,6 @@ namespace Chill\MainBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation as Serializer;
#[Serializer\DiscriminatorMap(typeProperty: 'type', mapping: ['chill_main_civility' => Civility::class])]
#[ORM\Entity]
#[ORM\Table(name: 'chill_main_civility')]
@@ -29,7 +28,6 @@ class Civility
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN)]
private bool $active = true;
#[Serializer\Groups(['read', 'docgen:read'])]
#[ORM\Id]
#[ORM\GeneratedValue]

View File

@@ -17,10 +17,6 @@ use Symfony\Component\Serializer\Annotation\Groups;
/**
* Country.
*
*
*
*
*/
#[ORM\Entity]
#[ORM\Cache(usage: 'READ_ONLY', region: 'country_cache_region')]
@@ -33,7 +29,6 @@ class Country
#[Context(['is-translatable' => true], groups: ['docgen:read'])]
private string $countryCode = '';
#[Groups(['read', 'docgen:read'])]
#[ORM\Id]
#[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)]
@@ -42,7 +37,6 @@ class Country
/**
* @var array<string, string>
*
*/
#[Groups(['read', 'docgen:read'])]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON)]

View File

@@ -13,7 +13,6 @@ namespace Chill\MainBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity]
#[ORM\Table(name: 'chill_main_cronjob_execution')]
class CronJobExecution

View File

@@ -15,12 +15,10 @@ use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation as Serializer;
use Symfony\Component\Validator\Constraints as Assert;
#[ORM\Entity]
#[ORM\Table(name: 'chill_main_dashboard_config_item')]
class DashboardConfigItem
{
#[Serializer\Groups(['dashboardConfigItem:read', 'read'])]
#[ORM\Id]
#[ORM\GeneratedValue]

View File

@@ -11,7 +11,6 @@ declare(strict_types=1);
namespace Chill\MainBundle\Entity\Embeddable;
use DateTime;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Embeddable]

View File

@@ -13,7 +13,6 @@ namespace Chill\MainBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(readOnly: true)]
#[ORM\Table(name: 'chill_main_geographical_unit')]
#[ORM\UniqueConstraint(name: 'geographical_unit_refid', columns: ['layer_id', 'unitRefId'])]
@@ -22,7 +21,6 @@ class GeographicalUnit
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT, nullable: true)]
private string $geom;
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER)]

View File

@@ -16,13 +16,11 @@ use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation as Serializer;
#[ORM\Entity]
#[ORM\Table(name: 'chill_main_geographical_unit_layer')]
#[ORM\UniqueConstraint(name: 'geographical_unit_layer_refid', columns: ['refId'])]
class GeographicalUnitLayer
{
#[Serializer\Groups(['read'])]
#[ORM\Id]
#[ORM\GeneratedValue]

View File

@@ -15,32 +15,28 @@ use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity]
#[ORM\Cache(usage: 'NONSTRICT_READ_WRITE', region: 'acl_cache_region')]
#[ORM\Table(name: 'group_centers')]
class GroupCenter
{
#[ORM\ManyToOne(targetEntity: \Chill\MainBundle\Entity\Center::class, inversedBy: 'groupCenters')]
#[ORM\ManyToOne(targetEntity: Center::class, inversedBy: 'groupCenters')]
#[ORM\Cache(usage: 'NONSTRICT_READ_WRITE')]
private ?Center $center = null;
#[ORM\Id]
#[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)]
#[ORM\GeneratedValue(strategy: 'AUTO')]
private ?int $id = null;
#[ORM\ManyToOne(targetEntity: \Chill\MainBundle\Entity\PermissionsGroup::class, inversedBy: 'groupCenters')]
#[ORM\ManyToOne(targetEntity: PermissionsGroup::class, inversedBy: 'groupCenters')]
#[ORM\Cache(usage: 'NONSTRICT_READ_WRITE')]
private ?PermissionsGroup $permissionsGroup = null;
/**
* @var Collection<User::class>
*/
#[ORM\ManyToMany(targetEntity: \Chill\MainBundle\Entity\User::class, mappedBy: 'groupCenters')]
#[ORM\ManyToMany(targetEntity: User::class, mappedBy: 'groupCenters')]
private Collection $users;
/**

View File

@@ -16,10 +16,6 @@ use Symfony\Component\Serializer\Annotation as Serializer;
/**
* Language.
*
*
*
*
*/
#[ORM\Entity]
#[ORM\Cache(usage: 'READ_ONLY', region: 'language_cache_region')]
@@ -27,7 +23,6 @@ use Symfony\Component\Serializer\Annotation as Serializer;
#[ORM\Table(name: 'language')]
class Language
{
#[Serializer\Groups(['docgen:read'])]
#[ORM\Id]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING)]
@@ -35,7 +30,6 @@ class Language
/**
* @var string array
*
*/
#[Serializer\Groups(['docgen:read'])]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON)]

View File

@@ -20,7 +20,6 @@ use libphonenumber\PhoneNumber;
use Symfony\Component\Serializer\Annotation as Serializer;
use Symfony\Component\Serializer\Annotation\DiscriminatorMap;
#[DiscriminatorMap(typeProperty: 'type', mapping: ['location' => Location::class])]
#[ORM\Entity(repositoryClass: LocationRepository::class)]
#[ORM\Table(name: 'chill_main_location')]
@@ -30,7 +29,6 @@ class Location implements TrackCreationInterface, TrackUpdateInterface
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN, nullable: true)]
private bool $active = true;
#[Serializer\Groups(['read', 'write', 'docgen:read'])]
#[ORM\ManyToOne(targetEntity: Address::class, cascade: ['persist'])]
#[ORM\JoinColumn(nullable: true)]
@@ -52,14 +50,12 @@ class Location implements TrackCreationInterface, TrackUpdateInterface
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 255, nullable: true)]
private ?string $email = null;
#[Serializer\Groups(['read', 'docgen:read'])]
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER)]
private ?int $id = null;
#[Serializer\Groups(['read', 'write', 'docgen:read'])]
#[ORM\ManyToOne(targetEntity: LocationType::class)]
#[ORM\JoinColumn(nullable: false)]

View File

@@ -17,7 +17,6 @@ use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
use Symfony\Component\Serializer\Annotation as Serializer;
use Symfony\Component\Serializer\Annotation\DiscriminatorMap;
#[DiscriminatorMap(typeProperty: 'type', mapping: ['location-type' => LocationType::class])]
#[UniqueEntity(['defaultFor'])]
#[ORM\Entity(repositoryClass: LocationTypeRepository::class)]
@@ -58,7 +57,6 @@ class LocationType
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN)]
private bool $editableByUsers = true;
#[Serializer\Groups(['read', 'docgen:read'])]
#[ORM\Id]
#[ORM\GeneratedValue]

View File

@@ -19,7 +19,6 @@ use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation\Groups;
use Symfony\Component\Validator\Constraints as Assert;
#[ORM\Entity]
#[ORM\Table(name: 'chill_main_news')]
class NewsItem implements TrackCreationInterface, TrackUpdateInterface
@@ -28,7 +27,6 @@ class NewsItem implements TrackCreationInterface, TrackUpdateInterface
use TrackUpdateTrait;
#[Groups(['read'])]
#[ORM\Id]
#[ORM\GeneratedValue]

View File

@@ -14,11 +14,11 @@ namespace Chill\MainBundle\Entity;
use Chill\MainBundle\Doctrine\Model\TrackUpdateInterface;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\Common\Collections\Order;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Component\Validator\Context\ExecutionContextInterface;
#[ORM\Entity]
#[ORM\HasLifecycleCallbacks]
#[ORM\Table(name: 'chill_main_notification')]
@@ -32,8 +32,6 @@ class Notification implements TrackUpdateInterface
/**
* @var Collection<User>
*
*
*/
#[ORM\ManyToMany(targetEntity: User::class)]
#[ORM\JoinTable(name: 'chill_main_notification_addresses_user')]
@@ -58,17 +56,14 @@ class Notification implements TrackUpdateInterface
/**
* @var Collection<NotificationComment>
*
*
*/
#[ORM\OneToMany(targetEntity: NotificationComment::class, mappedBy: 'notification', orphanRemoval: true)]
#[ORM\OrderBy(['createdAt' => \Doctrine\Common\Collections\Criteria::ASC])]
#[ORM\OrderBy(['createdAt' => 'ASC'])]
private Collection $comments;
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATETIME_IMMUTABLE)]
private \DateTimeImmutable $date;
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER)]
@@ -85,7 +80,6 @@ class Notification implements TrackUpdateInterface
private array $removedAddresses = [];
#[ORM\ManyToOne(targetEntity: User::class)]
#[ORM\JoinColumn(nullable: true)]
private ?User $sender = null;
@@ -96,8 +90,6 @@ class Notification implements TrackUpdateInterface
/**
* @var Collection<User>
*
*
*/
#[ORM\ManyToMany(targetEntity: User::class)]
#[ORM\JoinTable(name: 'chill_main_notification_addresses_unread')]

View File

@@ -18,7 +18,6 @@ use Doctrine\ORM\Event\PrePersistEventArgs;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
#[ORM\Entity]
#[ORM\HasLifecycleCallbacks]
#[ORM\Table('chill_main_notification_comment')]
@@ -31,18 +30,15 @@ class NotificationComment implements TrackCreationInterface, TrackUpdateInterfac
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATETIME_IMMUTABLE, nullable: true)]
private ?\DateTimeImmutable $createdAt = null;
#[ORM\ManyToOne(targetEntity: User::class)]
#[ORM\JoinColumn(nullable: true)]
private ?User $createdBy = null;
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER)]
private ?int $id = null;
#[ORM\ManyToOne(targetEntity: Notification::class, inversedBy: 'comments')]
#[ORM\JoinColumn(nullable: false)]
private ?Notification $notification = null;
@@ -60,7 +56,6 @@ class NotificationComment implements TrackCreationInterface, TrackUpdateInterfac
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATETIME_IMMUTABLE, nullable: true)]
private ?\DateTimeImmutable $updateAt = null;
#[ORM\ManyToOne(targetEntity: User::class)]
#[ORM\JoinColumn(nullable: true)]
private ?User $updatedBy = null;

View File

@@ -16,7 +16,6 @@ use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Context\ExecutionContextInterface;
#[ORM\Entity]
#[ORM\Cache(usage: 'NONSTRICT_READ_WRITE', region: 'acl_cache_region')]
#[ORM\Table(name: 'permission_groups')]
@@ -31,10 +30,9 @@ class PermissionsGroup
/**
* @var Collection<GroupCenter>
*/
#[ORM\OneToMany(targetEntity: \Chill\MainBundle\Entity\GroupCenter::class, mappedBy: 'permissionsGroup')]
#[ORM\OneToMany(targetEntity: GroupCenter::class, mappedBy: 'permissionsGroup')]
private Collection $groupCenters;
#[ORM\Id]
#[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)]
#[ORM\GeneratedValue(strategy: 'AUTO')]
@@ -45,10 +43,8 @@ class PermissionsGroup
/**
* @var Collection<RoleScope>
*
*
*/
#[ORM\ManyToMany(targetEntity: \Chill\MainBundle\Entity\RoleScope::class, inversedBy: 'permissionsGroups', cascade: ['persist'])]
#[ORM\ManyToMany(targetEntity: RoleScope::class, inversedBy: 'permissionsGroups', cascade: ['persist'])]
#[ORM\Cache(usage: 'NONSTRICT_READ_WRITE')]
private Collection $roleScopes;

View File

@@ -21,14 +21,6 @@ use Symfony\Component\Serializer\Annotation\Groups;
/**
* PostalCode.
*
*
*
*
*
*
*
*
*/
#[ORM\Entity]
#[ORM\HasLifecycleCallbacks]
@@ -62,13 +54,12 @@ class PostalCode implements TrackUpdateInterface, TrackCreationInterface
private ?string $code = null;
#[Groups(['write', 'read'])]
#[ORM\ManyToOne(targetEntity: \Chill\MainBundle\Entity\Country::class)]
#[ORM\ManyToOne(targetEntity: Country::class)]
private ?Country $country = null;
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATETIME_IMMUTABLE, nullable: true, options: ['default' => null])]
private ?\DateTimeImmutable $deletedAt = null;
#[Groups(['write', 'read'])]
#[ORM\Id]
#[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)]

View File

@@ -15,21 +15,17 @@ use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity]
#[ORM\Table(name: 'regroupment')]
class Regroupment
{
/**
*
*
* @var Collection<Center>
*/
#[ORM\ManyToMany(targetEntity: Center::class, inversedBy: 'regroupments')]
#[ORM\Id]
private Collection $centers;
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER)]

View File

@@ -15,13 +15,11 @@ use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity]
#[ORM\Cache(usage: 'NONSTRICT_READ_WRITE', region: 'acl_cache_region')]
#[ORM\Table(name: 'role_scopes')]
class RoleScope
{
#[ORM\Id]
#[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)]
#[ORM\GeneratedValue(strategy: 'AUTO')]
@@ -30,14 +28,13 @@ class RoleScope
/**
* @var Collection<PermissionsGroup>
*/
#[ORM\ManyToMany(targetEntity: \Chill\MainBundle\Entity\PermissionsGroup::class, mappedBy: 'roleScopes')]
#[ORM\ManyToMany(targetEntity: PermissionsGroup::class, mappedBy: 'roleScopes')]
private Collection $permissionsGroups;
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 255)]
private ?string $role = null;
#[ORM\ManyToOne(targetEntity: \Chill\MainBundle\Entity\Scope::class, inversedBy: 'roleScopes')]
#[ORM\ManyToOne(targetEntity: Scope::class, inversedBy: 'roleScopes')]
#[ORM\JoinColumn(nullable: true, name: 'scope_id')]
#[ORM\Cache(usage: 'NONSTRICT_READ_WRITE')]
private ?Scope $scope = null;

View File

@@ -20,7 +20,6 @@ use Ramsey\Uuid\Uuid;
use Ramsey\Uuid\UuidInterface;
use Symfony\Component\Validator\Constraints as Assert;
#[ORM\Entity]
#[ORM\Table(name: 'chill_main_saved_export')]
class SavedExport implements TrackCreationInterface, TrackUpdateInterface
@@ -36,9 +35,8 @@ class SavedExport implements TrackCreationInterface, TrackUpdateInterface
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT, nullable: false, options: ['default' => ''])]
private string $exportAlias;
#[ORM\Id]
#[ORM\Column(name: 'id', type: 'uuid', unique: 'true')]
#[ORM\Column(name: 'id', type: 'uuid', unique: true)]
#[ORM\GeneratedValue(strategy: 'NONE')]
private UuidInterface $id;

View File

@@ -18,7 +18,6 @@ use Symfony\Component\Serializer\Annotation\Context;
use Symfony\Component\Serializer\Annotation\DiscriminatorMap;
use Symfony\Component\Serializer\Annotation\Groups;
#[DiscriminatorMap(typeProperty: 'type', mapping: ['scope' => Scope::class])]
#[ORM\Entity]
#[ORM\Cache(usage: 'NONSTRICT_READ_WRITE', region: 'acl_cache_region')]
@@ -28,7 +27,6 @@ class Scope
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN, nullable: false, options: ['default' => true])]
private bool $active = true;
#[Groups(['read', 'docgen:read'])]
#[ORM\Id]
#[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)]
@@ -37,7 +35,6 @@ class Scope
/**
* translatable names.
*
*/
#[Groups(['read', 'docgen:read'])]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON)]
@@ -46,10 +43,8 @@ class Scope
/**
* @var Collection<RoleScope>
*
*
*/
#[ORM\OneToMany(targetEntity: \Chill\MainBundle\Entity\RoleScope::class, mappedBy: 'scope')]
#[ORM\OneToMany(targetEntity: RoleScope::class, mappedBy: 'scope')]
#[ORM\Cache(usage: 'NONSTRICT_READ_WRITE')]
private Collection $roleScopes;

View File

@@ -27,9 +27,6 @@ use Chill\MainBundle\Validation\Constraint\PhonenumberConstraint;
/**
* User.
*
*
*
*/
#[Serializer\DiscriminatorMap(typeProperty: 'type', mapping: ['user' => User::class])]
#[ORM\Entity]
@@ -37,7 +34,6 @@ use Chill\MainBundle\Validation\Constraint\PhonenumberConstraint;
#[ORM\Table(name: 'users')]
class User implements UserInterface, \Stringable, PasswordAuthenticatedUserInterface
{
#[ORM\Id]
#[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)]
#[ORM\GeneratedValue(strategy: 'AUTO')]
@@ -69,10 +65,8 @@ class User implements UserInterface, \Stringable, PasswordAuthenticatedUserInter
/**
* @var Collection<GroupCenter>
*
*
*/
#[ORM\ManyToMany(targetEntity: \Chill\MainBundle\Entity\GroupCenter::class, inversedBy: 'users')]
#[ORM\ManyToMany(targetEntity: GroupCenter::class, inversedBy: 'users')]
#[ORM\Cache(usage: 'NONSTRICT_READ_WRITE')]
private Collection $groupCenters;
@@ -118,7 +112,6 @@ class User implements UserInterface, \Stringable, PasswordAuthenticatedUserInter
/**
* The user's mobile phone number.
*
*
* @PhonenumberConstraint()
*/
#[ORM\Column(type: 'phone_number', nullable: true)]

View File

@@ -11,20 +11,17 @@ declare(strict_types=1);
namespace Chill\MainBundle\Entity\User;
use App\Repository\UserJobHistoryRepository;
use Chill\MainBundle\Entity\User;
use Chill\MainBundle\Entity\UserJob;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: UserJobHistoryRepository::class)]
#[ORM\Entity(repositoryClass: \Chill\MainBundle\Repository\User\UserJobHistoryRepository::class)]
#[ORM\Table(name: 'chill_main_user_job_history')]
class UserJobHistory
{
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATETIME_IMMUTABLE, nullable: true)]
private ?\DateTimeImmutable $endDate = null;
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER)]

View File

@@ -11,12 +11,11 @@ declare(strict_types=1);
namespace Chill\MainBundle\Entity\User;
use App\Repository\UserScopeHistoryRepository;
use Chill\MainBundle\Entity\Scope;
use Chill\MainBundle\Entity\User;
use Chill\MainBundle\Repository\User\UserScopeHistoryRepository;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: UserScopeHistoryRepository::class)]
#[ORM\Table(name: 'chill_main_user_scope_history')]
class UserScopeHistory
@@ -24,7 +23,6 @@ class UserScopeHistory
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATETIME_IMMUTABLE, nullable: true)]
private ?\DateTimeImmutable $endDate = null;
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER)]

View File

@@ -14,7 +14,6 @@ namespace Chill\MainBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation as Serializer;
#[Serializer\DiscriminatorMap(typeProperty: 'type', mapping: ['user_job' => UserJob::class])]
#[ORM\Entity]
#[ORM\Table('chill_main_user_job')]
@@ -23,7 +22,6 @@ class UserJob
#[ORM\Column(name: 'active', type: \Doctrine\DBAL\Types\Types::BOOLEAN)]
protected bool $active = true;
#[Serializer\Groups(['read', 'docgen:read'])]
#[ORM\Id]
#[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)]
@@ -32,7 +30,6 @@ class UserJob
/**
* @var array<string, string>
*
*/
#[Serializer\Groups(['read', 'docgen:read'])]
#[ORM\Column(name: 'label', type: \Doctrine\DBAL\Types\Types::JSON)]

View File

@@ -19,13 +19,12 @@ use Chill\MainBundle\Entity\User;
use Chill\MainBundle\Workflow\Validator\EntityWorkflowCreation;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\Common\Collections\Order;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation as Serializer;
use Symfony\Component\Validator\Constraints as Assert;
/**
*
*
* @EntityWorkflowCreation(groups={"creation"})
*/
#[Serializer\DiscriminatorMap(typeProperty: 'type', mapping: ['entity_workflow' => EntityWorkflow::class])]
@@ -72,7 +71,6 @@ class EntityWorkflow implements TrackCreationInterface, TrackUpdateInterface
#[ORM\OneToMany(targetEntity: EntityWorkflowComment::class, mappedBy: 'entityWorkflow', orphanRemoval: true)]
private Collection $comments;
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER)]
@@ -85,13 +83,11 @@ class EntityWorkflow implements TrackCreationInterface, TrackUpdateInterface
private int $relatedEntityId;
/**
*
*
* @var Collection<EntityWorkflowStep>
*/
#[Assert\Valid(traverse: true)]
#[ORM\OneToMany(targetEntity: EntityWorkflowStep::class, mappedBy: 'entityWorkflow', orphanRemoval: true, cascade: ['persist'])]
#[ORM\OrderBy(['transitionAt' => \Doctrine\Common\Collections\Criteria::ASC, 'id' => 'ASC'])]
#[ORM\OrderBy(['transitionAt' => Order::Ascending, 'id' => 'ASC'])]
private Collection $steps;
/**
@@ -100,8 +96,6 @@ class EntityWorkflow implements TrackCreationInterface, TrackUpdateInterface
private ?array $stepsChainedCache = null;
/**
*
*
* @var Collection<User>
*/
#[ORM\ManyToMany(targetEntity: User::class)]
@@ -109,8 +103,6 @@ class EntityWorkflow implements TrackCreationInterface, TrackUpdateInterface
private Collection $subscriberToFinal;
/**
*
*
* @var Collection<User>
*/
#[ORM\ManyToMany(targetEntity: User::class)]

View File

@@ -17,7 +17,6 @@ use Chill\MainBundle\Doctrine\Model\TrackUpdateInterface;
use Chill\MainBundle\Doctrine\Model\TrackUpdateTrait;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity]
#[ORM\Table('chill_main_workflow_entity_comment')]
class EntityWorkflowComment implements TrackCreationInterface, TrackUpdateInterface
@@ -32,7 +31,6 @@ class EntityWorkflowComment implements TrackCreationInterface, TrackUpdateInterf
#[ORM\ManyToOne(targetEntity: EntityWorkflow::class, inversedBy: 'comments')]
private ?EntityWorkflow $entityWorkflow = null;
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER)]

View File

@@ -18,7 +18,6 @@ use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Component\Validator\Context\ExecutionContextInterface;
#[ORM\Entity]
#[ORM\Table('chill_main_workflow_entity_step')]
class EntityWorkflowStep
@@ -28,8 +27,6 @@ class EntityWorkflowStep
/**
* @var Collection<User>
*
*
*/
#[ORM\ManyToMany(targetEntity: User::class)]
#[ORM\JoinTable(name: 'chill_main_workflow_entity_step_cc_user')]
@@ -46,8 +43,6 @@ class EntityWorkflowStep
/**
* @var Collection<User>
*
*
*/
#[ORM\ManyToMany(targetEntity: User::class)]
#[ORM\JoinTable(name: 'chill_main_workflow_entity_step_user')]
@@ -55,8 +50,6 @@ class EntityWorkflowStep
/**
* @var Collection<User>
*
*
*/
#[ORM\ManyToMany(targetEntity: User::class)]
#[ORM\JoinTable(name: 'chill_main_workflow_entity_step_user_by_accesskey')]
@@ -68,7 +61,6 @@ class EntityWorkflowStep
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN, options: ['default' => false])]
private bool $freezeAfter = false;
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER)]
@@ -93,7 +85,6 @@ class EntityWorkflowStep
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATETIME_IMMUTABLE, nullable: true, options: ['default' => null])]
private ?\DateTimeImmutable $transitionAt = null;
#[ORM\ManyToOne(targetEntity: User::class)]
#[ORM\JoinColumn(nullable: true)]
private ?User $transitionBy = null;