mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-29 02:53:50 +00:00
Apply rector rules: add annotation for doctrine mapping
This commit is contained in:
@@ -32,92 +32,68 @@ use Symfony\Component\Validator\Constraints as Assert;
|
||||
/**
|
||||
* Class Event.
|
||||
*
|
||||
* @ORM\Entity(repositoryClass="Chill\EventBundle\Repository\EventRepository")
|
||||
*
|
||||
* @ORM\Table(name="chill_event_event")
|
||||
*
|
||||
* @ORM\HasLifecycleCallbacks
|
||||
*/
|
||||
#[ORM\Entity(repositoryClass: \Chill\EventBundle\Repository\EventRepository::class)]
|
||||
#[ORM\HasLifecycleCallbacks]
|
||||
#[ORM\Table(name: 'chill_event_event')]
|
||||
class Event implements HasCenterInterface, HasScopeInterface, TrackCreationInterface, TrackUpdateInterface
|
||||
{
|
||||
use TrackCreationTrait;
|
||||
use TrackUpdateTrait;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity="Chill\MainBundle\Entity\Center")A
|
||||
*/
|
||||
#[Assert\NotNull]
|
||||
#[ORM\ManyToOne(targetEntity: \Chill\MainBundle\Entity\Center::class)] // A
|
||||
private ?Center $center = null;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity="Chill\MainBundle\Entity\Scope")
|
||||
*/
|
||||
#[ORM\ManyToOne(targetEntity: \Chill\MainBundle\Entity\Scope::class)]
|
||||
private ?Scope $circle = null;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="datetime")
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATETIME_MUTABLE)]
|
||||
private ?\DateTime $date;
|
||||
|
||||
/**
|
||||
* @ORM\Id
|
||||
*
|
||||
* @ORM\Column(name="id", type="integer")
|
||||
*
|
||||
* @ORM\GeneratedValue(strategy="AUTO")
|
||||
*/
|
||||
|
||||
#[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")
|
||||
*/
|
||||
#[ORM\ManyToOne(targetEntity: \Chill\MainBundle\Entity\User::class)]
|
||||
private ?User $moderator = null;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=150)
|
||||
*/
|
||||
#[Assert\NotBlank]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 150)]
|
||||
private ?string $name = null;
|
||||
|
||||
/**
|
||||
* @var Collection<Participation>
|
||||
*
|
||||
* @ORM\OneToMany(
|
||||
* targetEntity="Chill\EventBundle\Entity\Participation",
|
||||
* mappedBy="event")
|
||||
*/
|
||||
#[ORM\OneToMany(targetEntity: \Chill\EventBundle\Entity\Participation::class, mappedBy: 'event')]
|
||||
private Collection $participations;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity="Chill\EventBundle\Entity\EventType")
|
||||
*/
|
||||
#[Assert\NotNull]
|
||||
#[ORM\ManyToOne(targetEntity: \Chill\EventBundle\Entity\EventType::class)]
|
||||
private ?EventType $type = null;
|
||||
|
||||
/**
|
||||
* @ORM\Embedded(class=CommentEmbeddable::class, columnPrefix="comment_")
|
||||
*/
|
||||
#[ORM\Embedded(class: CommentEmbeddable::class, columnPrefix: 'comment_')]
|
||||
private CommentEmbeddable $comment;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity=Location::class)
|
||||
*
|
||||
* @ORM\JoinColumn(nullable=true)
|
||||
*/
|
||||
|
||||
#[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")
|
||||
*/
|
||||
#[ORM\ManyToMany(targetEntity: StoredObject::class, cascade: ['persist', 'refresh'])]
|
||||
#[ORM\JoinTable('chill_event_event_documents')]
|
||||
private Collection $documents;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="decimal", precision=10, scale=4, nullable=true, options={"default": null})
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DECIMAL, precision: 10, scale: 4, nullable: true, options: ['default' => null])]
|
||||
private string $organizationCost = '0.0';
|
||||
|
||||
/**
|
||||
|
@@ -18,51 +18,39 @@ use Doctrine\ORM\Mapping as ORM;
|
||||
/**
|
||||
* Class EventType.
|
||||
*
|
||||
* @ORM\Entity
|
||||
*
|
||||
* @ORM\Table(name="chill_event_event_type")
|
||||
*
|
||||
* @ORM\HasLifecycleCallbacks
|
||||
*/
|
||||
#[ORM\Entity]
|
||||
#[ORM\HasLifecycleCallbacks]
|
||||
#[ORM\Table(name: 'chill_event_event_type')]
|
||||
class EventType
|
||||
{
|
||||
/**
|
||||
* @ORM\Column(type="boolean", nullable=false)
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN, nullable: false)]
|
||||
private bool $active = true;
|
||||
|
||||
/**
|
||||
* @ORM\Id
|
||||
*
|
||||
* @ORM\Column(name="id", type="integer")
|
||||
*
|
||||
* @ORM\GeneratedValue(strategy="AUTO")
|
||||
*/
|
||||
|
||||
#[ORM\Id]
|
||||
#[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)]
|
||||
#[ORM\GeneratedValue(strategy: 'AUTO')]
|
||||
private ?int $id = null;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*
|
||||
* @ORM\Column(type="json")
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON)]
|
||||
private $name;
|
||||
|
||||
/**
|
||||
* @var Collection<Role>
|
||||
*
|
||||
* @ORM\OneToMany(
|
||||
* targetEntity="Chill\EventBundle\Entity\Role",
|
||||
* mappedBy="type")
|
||||
*/
|
||||
#[ORM\OneToMany(targetEntity: \Chill\EventBundle\Entity\Role::class, mappedBy: 'type')]
|
||||
private Collection $roles;
|
||||
|
||||
/**
|
||||
* @var Collection<Status>
|
||||
*
|
||||
* @ORM\OneToMany(
|
||||
* targetEntity="Chill\EventBundle\Entity\Status",
|
||||
* mappedBy="type")
|
||||
*/
|
||||
#[ORM\OneToMany(targetEntity: \Chill\EventBundle\Entity\Status::class, mappedBy: 'type')]
|
||||
private Collection $statuses;
|
||||
|
||||
/**
|
||||
|
@@ -27,55 +27,39 @@ use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
||||
/**
|
||||
* Class Participation.
|
||||
*
|
||||
* @ORM\Entity(
|
||||
* repositoryClass="Chill\EventBundle\Repository\ParticipationRepository")
|
||||
*
|
||||
* @ORM\Table(name="chill_event_participation", uniqueConstraints={
|
||||
*
|
||||
* @ORM\UniqueConstraint(name="chill_event_participation_event_person_unique_idx", columns={"event_id", "person_id"})
|
||||
* })
|
||||
* @ORM\UniqueConstraint(name="chill_event_participation_event_person_unique_idx", columns={"event_id", "person_id"})
|
||||
* })
|
||||
*
|
||||
* @ORM\HasLifecycleCallbacks
|
||||
*/
|
||||
#[UniqueEntity(['event', 'person'], message: 'event.validation.person_already_participate_to_event')]
|
||||
#[ORM\Entity(repositoryClass: \Chill\EventBundle\Repository\ParticipationRepository::class)]
|
||||
#[ORM\UniqueConstraint(name: 'chill_event_participation_event_person_unique_idx', columns: ['event_id', 'person_id'])] // @ORM\HasLifecycleCallbacks
|
||||
#[ORM\Table(name: 'chill_event_participation')]
|
||||
#[ORM\UniqueConstraint(name: 'chill_event_participation_event_person_unique_idx', columns: ['event_id', 'person_id'])]
|
||||
#[ORM\UniqueConstraint(name: 'chill_event_participation_event_person_unique_idx', columns: ['event_id', 'person_id'])]
|
||||
#[ORM\HasLifecycleCallbacks] // @ORM\HasLifecycleCallbacks
|
||||
class Participation implements \ArrayAccess, HasCenterInterface, HasScopeInterface, TrackUpdateInterface, TrackCreationInterface
|
||||
{
|
||||
use TrackCreationTrait;
|
||||
use TrackUpdateTrait;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(
|
||||
* targetEntity="Chill\EventBundle\Entity\Event",
|
||||
* inversedBy="participations")
|
||||
*/
|
||||
#[ORM\ManyToOne(targetEntity: \Chill\EventBundle\Entity\Event::class, inversedBy: 'participations')]
|
||||
private ?Event $event = null;
|
||||
|
||||
/**
|
||||
* @ORM\Id
|
||||
*
|
||||
* @ORM\Column(name="id", type="integer")
|
||||
*
|
||||
* @ORM\GeneratedValue(strategy="AUTO")
|
||||
*/
|
||||
|
||||
#[ORM\Id]
|
||||
#[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)]
|
||||
#[ORM\GeneratedValue(strategy: 'AUTO')]
|
||||
private ?int $id = null;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity="Chill\PersonBundle\Entity\Person")
|
||||
*/
|
||||
#[Assert\NotNull]
|
||||
#[ORM\ManyToOne(targetEntity: \Chill\PersonBundle\Entity\Person::class)]
|
||||
private ?Person $person = null;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity="Chill\EventBundle\Entity\Role")
|
||||
*/
|
||||
#[ORM\ManyToOne(targetEntity: \Chill\EventBundle\Entity\Role::class)]
|
||||
private ?Role $role = null;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity="Chill\EventBundle\Entity\Status")
|
||||
*/
|
||||
#[Assert\NotNull]
|
||||
#[ORM\ManyToOne(targetEntity: \Chill\EventBundle\Entity\Status::class)]
|
||||
private ?Status $status = null;
|
||||
|
||||
public function getCenter()
|
||||
|
@@ -16,40 +16,30 @@ use Doctrine\ORM\Mapping as ORM;
|
||||
/**
|
||||
* Class Role.
|
||||
*
|
||||
* @ORM\Entity
|
||||
*
|
||||
* @ORM\Table(name="chill_event_role")
|
||||
*
|
||||
* @ORM\HasLifecycleCallbacks
|
||||
*/
|
||||
#[ORM\Entity]
|
||||
#[ORM\HasLifecycleCallbacks]
|
||||
#[ORM\Table(name: 'chill_event_role')]
|
||||
class Role
|
||||
{
|
||||
/**
|
||||
* @ORM\Column(type="boolean", nullable=false)
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN, nullable: false)]
|
||||
private bool $active = true;
|
||||
|
||||
/**
|
||||
* @ORM\Id
|
||||
*
|
||||
* @ORM\Column(name="id", type="integer")
|
||||
*
|
||||
* @ORM\GeneratedValue(strategy="AUTO")
|
||||
*/
|
||||
|
||||
#[ORM\Id]
|
||||
#[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)]
|
||||
#[ORM\GeneratedValue(strategy: 'AUTO')]
|
||||
private ?int $id = null;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*
|
||||
* @ORM\Column(type="json")
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON)]
|
||||
private $name;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(
|
||||
* targetEntity="Chill\EventBundle\Entity\EventType",
|
||||
* inversedBy="roles")
|
||||
*/
|
||||
#[ORM\ManyToOne(targetEntity: \Chill\EventBundle\Entity\EventType::class, inversedBy: 'roles')]
|
||||
private ?EventType $type = null;
|
||||
|
||||
/**
|
||||
|
@@ -16,40 +16,30 @@ use Doctrine\ORM\Mapping as ORM;
|
||||
/**
|
||||
* Class Status.
|
||||
*
|
||||
* @ORM\Entity
|
||||
*
|
||||
* @ORM\Table(name="chill_event_status")
|
||||
*
|
||||
* @ORM\HasLifecycleCallbacks
|
||||
*/
|
||||
#[ORM\Entity]
|
||||
#[ORM\HasLifecycleCallbacks]
|
||||
#[ORM\Table(name: 'chill_event_status')]
|
||||
class Status
|
||||
{
|
||||
/**
|
||||
* @ORM\Column(type="boolean", nullable=false)
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN, nullable: false)]
|
||||
private bool $active = true;
|
||||
|
||||
/**
|
||||
* @ORM\Id
|
||||
*
|
||||
* @ORM\Column(name="id", type="integer")
|
||||
*
|
||||
* @ORM\GeneratedValue(strategy="AUTO")
|
||||
*/
|
||||
|
||||
#[ORM\Id]
|
||||
#[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)]
|
||||
#[ORM\GeneratedValue(strategy: 'AUTO')]
|
||||
private ?int $id = null;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*
|
||||
* @ORM\Column(type="json")
|
||||
*/
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON)]
|
||||
private $name;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(
|
||||
* targetEntity="Chill\EventBundle\Entity\EventType",
|
||||
* inversedBy="statuses")
|
||||
*/
|
||||
#[ORM\ManyToOne(targetEntity: \Chill\EventBundle\Entity\EventType::class, inversedBy: 'statuses')]
|
||||
private ?EventType $type = null;
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user