Skip to content

Commit

Permalink
Agenda: Add property types #5977
Browse files Browse the repository at this point in the history
  • Loading branch information
AngelFQC committed Jan 15, 2025
1 parent e050721 commit 7ea28f8
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 34 deletions.
10 changes: 3 additions & 7 deletions src/Chamilo/CoreBundle/Entity/AgendaEventInvitation.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,29 +26,25 @@ class AgendaEventInvitation
use TimestampableTypedEntity;

/**
* @var int
*
* @ORM\Id()
* @ORM\Column(type="bigint")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
protected ?int $id;

/**
* @var Collection<int, AgendaEventInvitee>
*
* @ORM\OneToMany(targetEntity="AgendaEventInvitee", mappedBy="invitation", cascade={"persist", "remove"},
* orphanRemoval=true)
*/
protected $invitees;
protected Collection $invitees;

/**
* @var User
*
* @ORM\ManyToOne(targetEntity="Chamilo\UserBundle\Entity\User", inversedBy="resourceNodes")
* @ORM\JoinColumn(name="creator_id", referencedColumnName="id", nullable=true, onDelete="CASCADE")
*/
protected $creator;
protected User $creator;

public function __construct()
{
Expand Down
12 changes: 3 additions & 9 deletions src/Chamilo/CoreBundle/Entity/AgendaEventInvitee.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,29 +24,23 @@ class AgendaEventInvitee
use TimestampableTypedEntity;

/**
* @var int
*
* @ORM\Id()
* @ORM\Column(type="bigint")
* @ORM\GeneratedValue
*/
protected $id;
protected ?int $id;

/**
* @var AgendaEventInvitation|null
*
* @ORM\ManyToOne(targetEntity="AgendaEventInvitation", inversedBy="invitees")
* @ORM\JoinColumn(name="invitation_id", referencedColumnName="id", onDelete="CASCADE")
*/
protected $invitation;
protected ?AgendaEventInvitation $invitation;

/**
* @var User|null
*
* @ORM\ManyToOne(targetEntity="Chamilo\UserBundle\Entity\User")
* @ORM\JoinColumn(name="user_id", referencedColumnName="id", nullable=true, onDelete="SET NULL")
*/
protected $user;
protected ?User $user;

public function getId(): int
{
Expand Down
4 changes: 1 addition & 3 deletions src/Chamilo/CoreBundle/Entity/AgendaEventSubscription.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,9 @@ class AgendaEventSubscription extends AgendaEventInvitation
public const SUBSCRIPTION_CLASS = 2;

/**
* @var int
*
* @ORM\Column(name="max_attendees", type="integer", nullable=false, options={"default": 0})
*/
protected $maxAttendees = 0;
protected int $maxAttendees = 0;

public function getMaxAttendees(): int
{
Expand Down
20 changes: 5 additions & 15 deletions src/Chamilo/CoreBundle/Entity/AgendaReminder.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,41 +17,31 @@ class AgendaReminder
use TimestampableTypedEntity;

/**
* @var int
*
* @ORM\Id()
* @ORM\Column(type="bigint")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
protected ?int $id;

/**
* @var string
*
* @ORM\Column(name="type", type="string")
*/
protected $type;
protected string $type;

/**
* @var int
*
* @ORM\Column(name="event_id", type="integer")
*/
protected $eventId;
protected int $eventId;

/**
* @var \DateInterval
*
* @ORM\Column(name="date_interval", type="dateinterval")
*/
protected $dateInterval;
protected \DateInterval $dateInterval;

/**
* @var bool
*
* @ORM\Column(name="sent", type="boolean")
*/
protected $sent;
protected bool $sent;

public function __construct()
{
Expand Down

0 comments on commit 7ea28f8

Please sign in to comment.