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

@@ -23,7 +23,6 @@ use Chill\MainBundle\Entity\HasScopeInterface;
use Chill\MainBundle\Entity\Location;
use Chill\MainBundle\Entity\Scope;
use Chill\MainBundle\Entity\User;
use DateTime;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
@@ -31,9 +30,6 @@ use Symfony\Component\Validator\Constraints as Assert;
/**
* Class Event.
*
*
*
*/
#[ORM\Entity(repositoryClass: \Chill\EventBundle\Repository\EventRepository::class)]
#[ORM\HasLifecycleCallbacks]
@@ -44,22 +40,21 @@ class Event implements HasCenterInterface, HasScopeInterface, TrackCreationInter
use TrackUpdateTrait;
#[Assert\NotNull]
#[ORM\ManyToOne(targetEntity: \Chill\MainBundle\Entity\Center::class)] // A
#[ORM\ManyToOne(targetEntity: Center::class)] // A
private ?Center $center = null;
#[ORM\ManyToOne(targetEntity: \Chill\MainBundle\Entity\Scope::class)]
#[ORM\ManyToOne(targetEntity: Scope::class)]
private ?Scope $circle = null;
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATETIME_MUTABLE)]
private ?\DateTime $date;
#[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\User::class)]
#[ORM\ManyToOne(targetEntity: User::class)]
private ?User $moderator = null;
#[Assert\NotBlank]
@@ -69,25 +64,22 @@ class Event implements HasCenterInterface, HasScopeInterface, TrackCreationInter
/**
* @var Collection<Participation>
*/
#[ORM\OneToMany(targetEntity: \Chill\EventBundle\Entity\Participation::class, mappedBy: 'event')]
#[ORM\OneToMany(targetEntity: Participation::class, mappedBy: 'event')]
private Collection $participations;
#[Assert\NotNull]
#[ORM\ManyToOne(targetEntity: \Chill\EventBundle\Entity\EventType::class)]
#[ORM\ManyToOne(targetEntity: EventType::class)]
private ?EventType $type = null;
#[ORM\Embedded(class: CommentEmbeddable::class, columnPrefix: 'comment_')]
private CommentEmbeddable $comment;
#[ORM\ManyToOne(targetEntity: Location::class)]
#[ORM\JoinColumn(nullable: true)]
private ?Location $location = null;
/**
* @var Collection<StoredObject>
*
*
*/
#[ORM\ManyToMany(targetEntity: StoredObject::class, cascade: ['persist', 'refresh'])]
#[ORM\JoinTable('chill_event_event_documents')]

View File

@@ -17,9 +17,6 @@ use Doctrine\ORM\Mapping as ORM;
/**
* Class EventType.
*
*
*
*/
#[ORM\Entity]
#[ORM\HasLifecycleCallbacks]
@@ -29,7 +26,6 @@ class EventType
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN, nullable: false)]
private bool $active = true;
#[ORM\Id]
#[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)]
#[ORM\GeneratedValue(strategy: 'AUTO')]
@@ -44,13 +40,13 @@ class EventType
/**
* @var Collection<Role>
*/
#[ORM\OneToMany(targetEntity: \Chill\EventBundle\Entity\Role::class, mappedBy: 'type')]
#[ORM\OneToMany(targetEntity: Role::class, mappedBy: 'type')]
private Collection $roles;
/**
* @var Collection<Status>
*/
#[ORM\OneToMany(targetEntity: \Chill\EventBundle\Entity\Status::class, mappedBy: 'type')]
#[ORM\OneToMany(targetEntity: Status::class, mappedBy: 'type')]
private Collection $statuses;
/**

View File

@@ -26,9 +26,6 @@ use Symfony\Component\Validator\Context\ExecutionContextInterface;
/**
* Class Participation.
*
*
*
*/
#[UniqueEntity(['event', 'person'], message: 'event.validation.person_already_participate_to_event')]
#[ORM\Entity(repositoryClass: \Chill\EventBundle\Repository\ParticipationRepository::class)]
@@ -42,24 +39,23 @@ class Participation implements \ArrayAccess, HasCenterInterface, HasScopeInterfa
use TrackCreationTrait;
use TrackUpdateTrait;
#[ORM\ManyToOne(targetEntity: \Chill\EventBundle\Entity\Event::class, inversedBy: 'participations')]
#[ORM\ManyToOne(targetEntity: Event::class, inversedBy: 'participations')]
private ?Event $event = null;
#[ORM\Id]
#[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)]
#[ORM\GeneratedValue(strategy: 'AUTO')]
private ?int $id = null;
#[Assert\NotNull]
#[ORM\ManyToOne(targetEntity: \Chill\PersonBundle\Entity\Person::class)]
#[ORM\ManyToOne(targetEntity: Person::class)]
private ?Person $person = null;
#[ORM\ManyToOne(targetEntity: \Chill\EventBundle\Entity\Role::class)]
#[ORM\ManyToOne(targetEntity: Role::class)]
private ?Role $role = null;
#[Assert\NotNull]
#[ORM\ManyToOne(targetEntity: \Chill\EventBundle\Entity\Status::class)]
#[ORM\ManyToOne(targetEntity: Status::class)]
private ?Status $status = null;
public function getCenter()

View File

@@ -15,9 +15,6 @@ use Doctrine\ORM\Mapping as ORM;
/**
* Class Role.
*
*
*
*/
#[ORM\Entity]
#[ORM\HasLifecycleCallbacks]
@@ -27,7 +24,6 @@ class Role
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN, nullable: false)]
private bool $active = true;
#[ORM\Id]
#[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)]
#[ORM\GeneratedValue(strategy: 'AUTO')]
@@ -39,7 +35,7 @@ class Role
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON)]
private $name;
#[ORM\ManyToOne(targetEntity: \Chill\EventBundle\Entity\EventType::class, inversedBy: 'roles')]
#[ORM\ManyToOne(targetEntity: EventType::class, inversedBy: 'roles')]
private ?EventType $type = null;
/**

View File

@@ -15,9 +15,6 @@ use Doctrine\ORM\Mapping as ORM;
/**
* Class Status.
*
*
*
*/
#[ORM\Entity]
#[ORM\HasLifecycleCallbacks]
@@ -27,7 +24,6 @@ class Status
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN, nullable: false)]
private bool $active = true;
#[ORM\Id]
#[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)]
#[ORM\GeneratedValue(strategy: 'AUTO')]
@@ -39,7 +35,7 @@ class Status
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON)]
private $name;
#[ORM\ManyToOne(targetEntity: \Chill\EventBundle\Entity\EventType::class, inversedBy: 'statuses')]
#[ORM\ManyToOne(targetEntity: EventType::class, inversedBy: 'statuses')]
private ?EventType $type = null;
/**