diff --git a/src/Bundle/ChillActivityBundle/Entity/Activity.php b/src/Bundle/ChillActivityBundle/Entity/Activity.php index bac5df2e0..f69c9c705 100644 --- a/src/Bundle/ChillActivityBundle/Entity/Activity.php +++ b/src/Bundle/ChillActivityBundle/Entity/Activity.php @@ -32,7 +32,6 @@ use Chill\PersonBundle\Entity\Person; use Chill\PersonBundle\Entity\SocialWork\SocialAction; use Chill\PersonBundle\Entity\SocialWork\SocialIssue; use Chill\ThirdPartyBundle\Entity\ThirdParty; -use DateTime; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\Collection; use Doctrine\ORM\Mapping as ORM; @@ -44,9 +43,6 @@ use Symfony\Component\Validator\Constraints as Assert; /** * Class Activity. * - * - * - * * @ActivityValidator\ActivityValidity * * TODO see if necessary @@ -70,22 +66,21 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac final public const SENTRECEIVED_SENT = 'sent'; #[Groups(['read'])] - #[ORM\ManyToOne(targetEntity: \Chill\PersonBundle\Entity\AccompanyingPeriod::class)] + #[ORM\ManyToOne(targetEntity: AccompanyingPeriod::class)] private ?AccompanyingPeriod $accompanyingPeriod = null; - #[Groups(['read', 'docgen:read'])] #[SerializedName('activityType')] - #[ORM\ManyToOne(targetEntity: \Chill\ActivityBundle\Entity\ActivityType::class)] + #[ORM\ManyToOne(targetEntity: ActivityType::class)] #[ORM\JoinColumn(name: 'type_id')] private ActivityType $activityType; #[Groups(['docgen:read'])] - #[ORM\ManyToOne(targetEntity: \Chill\ActivityBundle\Entity\ActivityPresence::class)] + #[ORM\ManyToOne(targetEntity: ActivityPresence::class)] private ?ActivityPresence $attendee = null; #[Groups(['docgen:read'])] - #[ORM\Embedded(class: \Chill\MainBundle\Entity\Embeddable\CommentEmbeddable::class, columnPrefix: 'comment_')] + #[ORM\Embedded(class: CommentEmbeddable::class, columnPrefix: 'comment_')] private CommentEmbeddable $comment; #[Groups(['docgen:read'])] @@ -96,7 +91,7 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac * @var Collection */ #[Assert\Valid(traverse: true)] - #[ORM\ManyToMany(targetEntity: \Chill\DocStoreBundle\Entity\StoredObject::class, cascade: ['persist'])] + #[ORM\ManyToMany(targetEntity: StoredObject::class, cascade: ['persist'])] private Collection $documents; #[ORM\Column(type: \Doctrine\DBAL\Types\Types::TIME_MUTABLE, nullable: true)] @@ -106,7 +101,6 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac #[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN, options: ['default' => false])] private bool $emergency = false; - #[Groups(['read', 'docgen:read'])] #[ORM\Id] #[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)] @@ -114,31 +108,31 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac private ?int $id = null; #[Groups(['read', 'docgen:read'])] - #[ORM\ManyToOne(targetEntity: \Chill\MainBundle\Entity\Location::class)] + #[ORM\ManyToOne(targetEntity: Location::class)] private ?Location $location = null; - #[ORM\ManyToOne(targetEntity: \Chill\PersonBundle\Entity\Person::class)] + #[ORM\ManyToOne(targetEntity: Person::class)] private ?Person $person = null; /** * @var Collection */ #[Groups(['read', 'docgen:read'])] - #[ORM\ManyToMany(targetEntity: \Chill\PersonBundle\Entity\Person::class)] + #[ORM\ManyToMany(targetEntity: Person::class)] private Collection $persons; - #[ORM\Embedded(class: \Chill\MainBundle\Entity\Embeddable\PrivateCommentEmbeddable::class, columnPrefix: 'privateComment_')] + #[ORM\Embedded(class: PrivateCommentEmbeddable::class, columnPrefix: 'privateComment_')] private PrivateCommentEmbeddable $privateComment; /** * @var Collection */ #[Groups(['docgen:read'])] - #[ORM\ManyToMany(targetEntity: \Chill\ActivityBundle\Entity\ActivityReason::class)] + #[ORM\ManyToMany(targetEntity: ActivityReason::class)] private Collection $reasons; #[Groups(['docgen:read'])] - #[ORM\ManyToOne(targetEntity: \Chill\MainBundle\Entity\Scope::class)] + #[ORM\ManyToOne(targetEntity: Scope::class)] private ?Scope $scope = null; #[Groups(['docgen:read'])] @@ -146,22 +140,18 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac private string $sentReceived = ''; /** - * - * * @var Collection */ #[Groups(['read', 'docgen:read'])] - #[ORM\ManyToMany(targetEntity: \Chill\PersonBundle\Entity\SocialWork\SocialAction::class)] + #[ORM\ManyToMany(targetEntity: SocialAction::class)] #[ORM\JoinTable(name: 'chill_activity_activity_chill_person_socialaction')] private Collection $socialActions; /** - * - * * @var Collection */ #[Groups(['read', 'docgen:read'])] - #[ORM\ManyToMany(targetEntity: \Chill\PersonBundle\Entity\SocialWork\SocialIssue::class)] + #[ORM\ManyToMany(targetEntity: SocialIssue::class)] #[ORM\JoinTable(name: 'chill_activity_activity_chill_person_socialissue')] private Collection $socialIssues; @@ -169,21 +159,21 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac * @var Collection */ #[Groups(['read', 'docgen:read'])] - #[ORM\ManyToMany(targetEntity: \Chill\ThirdPartyBundle\Entity\ThirdParty::class)] + #[ORM\ManyToMany(targetEntity: ThirdParty::class)] private Collection $thirdParties; #[ORM\Column(type: \Doctrine\DBAL\Types\Types::TIME_MUTABLE, nullable: true)] private ?\DateTime $travelTime = null; #[Groups(['docgen:read'])] - #[ORM\ManyToOne(targetEntity: \Chill\MainBundle\Entity\User::class)] + #[ORM\ManyToOne(targetEntity: User::class)] private ?User $user = null; /** * @var Collection */ #[Groups(['read', 'docgen:read'])] - #[ORM\ManyToMany(targetEntity: \Chill\MainBundle\Entity\User::class)] + #[ORM\ManyToMany(targetEntity: User::class)] private Collection $users; public function __construct() diff --git a/src/Bundle/ChillActivityBundle/Entity/ActivityPresence.php b/src/Bundle/ChillActivityBundle/Entity/ActivityPresence.php index e89158abd..245d51b1d 100644 --- a/src/Bundle/ChillActivityBundle/Entity/ActivityPresence.php +++ b/src/Bundle/ChillActivityBundle/Entity/ActivityPresence.php @@ -16,9 +16,6 @@ use Symfony\Component\Serializer\Annotation as Serializer; /** * Class ActivityPresence. - * - * - * */ #[ORM\Entity] #[ORM\HasLifecycleCallbacks] @@ -28,18 +25,15 @@ class ActivityPresence #[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN)] private bool $active = true; - #[Serializer\Groups(['docgen:read'])] #[ORM\Id] #[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)] #[ORM\GeneratedValue(strategy: 'AUTO')] private ?int $id = null; - /** - * @Serializer\Context({"is-translatable": true}, groups={"docgen:read"}) - */ #[Serializer\Groups(['docgen:read'])] #[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON)] + #[Serializer\Context(['is-translatable' => true], groups: ['docgen:read'])] private array $name = []; /** diff --git a/src/Bundle/ChillActivityBundle/Entity/ActivityReason.php b/src/Bundle/ChillActivityBundle/Entity/ActivityReason.php index 6219acb9e..5c6576497 100644 --- a/src/Bundle/ChillActivityBundle/Entity/ActivityReason.php +++ b/src/Bundle/ChillActivityBundle/Entity/ActivityReason.php @@ -15,9 +15,6 @@ use Doctrine\ORM\Mapping as ORM; /** * Class ActivityReason. - * - * - * */ #[ORM\Entity] #[ORM\HasLifecycleCallbacks] @@ -27,10 +24,9 @@ class ActivityReason #[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN)] private bool $active = true; - #[ORM\ManyToOne(targetEntity: \Chill\ActivityBundle\Entity\ActivityReasonCategory::class, inversedBy: 'reasons')] + #[ORM\ManyToOne(targetEntity: ActivityReasonCategory::class, inversedBy: 'reasons')] private ?ActivityReasonCategory $category = null; - #[ORM\Id] #[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)] #[ORM\GeneratedValue(strategy: 'AUTO')] diff --git a/src/Bundle/ChillActivityBundle/Entity/ActivityReasonCategory.php b/src/Bundle/ChillActivityBundle/Entity/ActivityReasonCategory.php index bd0cecf5a..9346d12a0 100644 --- a/src/Bundle/ChillActivityBundle/Entity/ActivityReasonCategory.php +++ b/src/Bundle/ChillActivityBundle/Entity/ActivityReasonCategory.php @@ -17,9 +17,6 @@ use Doctrine\ORM\Mapping as ORM; /** * Class ActivityReasonCategory. - * - * - * */ #[ORM\Entity] #[ORM\HasLifecycleCallbacks] @@ -29,7 +26,6 @@ class ActivityReasonCategory implements \Stringable #[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN)] private bool $active = true; - #[ORM\Id] #[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)] #[ORM\GeneratedValue(strategy: 'AUTO')] @@ -46,7 +42,7 @@ class ActivityReasonCategory implements \Stringable * * @var Collection */ - #[ORM\OneToMany(targetEntity: \Chill\ActivityBundle\Entity\ActivityReason::class, mappedBy: 'category')] + #[ORM\OneToMany(targetEntity: ActivityReason::class, mappedBy: 'category')] private Collection $reasons; /** diff --git a/src/Bundle/ChillActivityBundle/Entity/ActivityType.php b/src/Bundle/ChillActivityBundle/Entity/ActivityType.php index fd9a38c95..f32dc5264 100644 --- a/src/Bundle/ChillActivityBundle/Entity/ActivityType.php +++ b/src/Bundle/ChillActivityBundle/Entity/ActivityType.php @@ -19,9 +19,6 @@ use Symfony\Component\Validator\Context\ExecutionContextInterface; /** * Class ActivityType. - * - * - * */ #[ORM\Entity] #[ORM\HasLifecycleCallbacks] @@ -56,7 +53,7 @@ class ActivityType #[ORM\Column(type: \Doctrine\DBAL\Types\Types::SMALLINT, nullable: false, options: ['default' => 1])] private int $attendeeVisible = self::FIELD_OPTIONAL; - #[ORM\ManyToOne(targetEntity: \Chill\ActivityBundle\Entity\ActivityTypeCategory::class)] + #[ORM\ManyToOne(targetEntity: ActivityTypeCategory::class)] private ?ActivityTypeCategory $category = null; #[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, nullable: false, options: ['default' => ''])] @@ -89,7 +86,6 @@ class ActivityType #[ORM\Column(type: \Doctrine\DBAL\Types\Types::SMALLINT, nullable: false, options: ['default' => 1])] private int $emergencyVisible = self::FIELD_INVISIBLE; - #[Groups(['docgen:read'])] #[ORM\Id] #[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)] @@ -102,11 +98,9 @@ class ActivityType #[ORM\Column(type: \Doctrine\DBAL\Types\Types::SMALLINT, nullable: false, options: ['default' => 1])] private int $locationVisible = self::FIELD_INVISIBLE; - /** - * @Serializer\Context({"is-translatable": true}, groups={"docgen:read"}) - */ #[Groups(['read', 'docgen:read'])] #[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON)] + #[Serializer\Context(['is-translatable' => true], groups: ['docgen:read'])] private array $name = []; #[ORM\Column(type: \Doctrine\DBAL\Types\Types::FLOAT, options: ['default' => '0.0'])] diff --git a/src/Bundle/ChillActivityBundle/Entity/ActivityTypeCategory.php b/src/Bundle/ChillActivityBundle/Entity/ActivityTypeCategory.php index d70535bbf..b9e694f2b 100644 --- a/src/Bundle/ChillActivityBundle/Entity/ActivityTypeCategory.php +++ b/src/Bundle/ChillActivityBundle/Entity/ActivityTypeCategory.php @@ -13,7 +13,6 @@ namespace Chill\ActivityBundle\Entity; use Doctrine\ORM\Mapping as ORM; - #[ORM\Entity] #[ORM\HasLifecycleCallbacks] #[ORM\Table(name: 'activitytypecategory')] @@ -22,7 +21,6 @@ class ActivityTypeCategory #[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN)] private bool $active = true; - #[ORM\Id] #[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)] #[ORM\GeneratedValue(strategy: 'AUTO')] diff --git a/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivity.php b/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivity.php index ee58f31b7..b7671c61a 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivity.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivity.php @@ -18,12 +18,10 @@ use Chill\MainBundle\Entity\Location; use Doctrine\ORM\Mapping as ORM; use Symfony\Component\Validator\Constraints as Assert; - #[ORM\Entity] #[ORM\Table(schema: 'chill_asideactivity')] class AsideActivity implements TrackCreationInterface, TrackUpdateInterface { - #[Assert\NotBlank] #[ORM\ManyToOne(targetEntity: User::class)] #[ORM\JoinColumn(nullable: false)] @@ -32,7 +30,6 @@ class AsideActivity implements TrackCreationInterface, TrackUpdateInterface #[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATETIME_MUTABLE)] private ?\DateTimeInterface $createdAt = null; - #[ORM\ManyToOne(targetEntity: User::class)] #[ORM\JoinColumn(nullable: false)] private User $createdBy; @@ -43,13 +40,11 @@ class AsideActivity implements TrackCreationInterface, TrackUpdateInterface #[ORM\Column(type: \Doctrine\DBAL\Types\Types::TIME_MUTABLE, nullable: true)] private ?\DateTimeInterface $duration = null; - #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER)] private ?int $id = null; - #[ORM\ManyToOne(targetEntity: Location::class)] #[ORM\JoinColumn(nullable: true)] private ?Location $location = null; @@ -57,7 +52,6 @@ class AsideActivity implements TrackCreationInterface, TrackUpdateInterface #[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT, nullable: true)] private ?string $note = null; - #[ORM\ManyToOne(targetEntity: AsideActivityCategory::class, inversedBy: 'asideActivities')] #[ORM\JoinColumn(nullable: false)] private ?AsideActivityCategory $type = null; diff --git a/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivityCategory.php b/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivityCategory.php index ebf09e59c..1758cdd3d 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivityCategory.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivityCategory.php @@ -17,7 +17,6 @@ use Doctrine\ORM\Mapping as ORM; use Symfony\Component\Validator\Constraints as Assert; use Symfony\Component\Validator\Context\ExecutionContextInterface; - #[ORM\Entity] #[ORM\Table(schema: 'chill_asideactivity')] class AsideActivityCategory @@ -28,7 +27,6 @@ class AsideActivityCategory #[ORM\OneToMany(targetEntity: AsideActivityCategory::class, mappedBy: 'parent')] private Collection $children; - #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER)] @@ -42,7 +40,6 @@ class AsideActivityCategory #[ORM\Column(type: \Doctrine\DBAL\Types\Types::FLOAT, options: ['default' => '0.00'])] private float $ordering = 0.00; - #[ORM\ManyToOne(targetEntity: AsideActivityCategory::class, inversedBy: 'children')] #[ORM\JoinColumn(nullable: true)] private ?AsideActivityCategory $parent = null; diff --git a/src/Bundle/ChillBudgetBundle/Entity/AbstractElement.php b/src/Bundle/ChillBudgetBundle/Entity/AbstractElement.php index a348a0d07..d3321531a 100644 --- a/src/Bundle/ChillBudgetBundle/Entity/AbstractElement.php +++ b/src/Bundle/ChillBudgetBundle/Entity/AbstractElement.php @@ -13,9 +13,7 @@ namespace Chill\BudgetBundle\Entity; use Chill\PersonBundle\Entity\Household\Household; use Chill\PersonBundle\Entity\Person; -use DateTime; use Doctrine\ORM\Mapping as ORM; -use Ramsey\Uuid\Type\Decimal; use Symfony\Component\Validator\Constraints as Assert; /** diff --git a/src/Bundle/ChillBudgetBundle/Entity/Charge.php b/src/Bundle/ChillBudgetBundle/Entity/Charge.php index 5c78398b5..5857b8b67 100644 --- a/src/Bundle/ChillBudgetBundle/Entity/Charge.php +++ b/src/Bundle/ChillBudgetBundle/Entity/Charge.php @@ -17,8 +17,6 @@ use Doctrine\ORM\Mapping as ORM; /** * Charge. - * - * */ #[ORM\Entity(repositoryClass: \Chill\BudgetBundle\Repository\ChargeRepository::class)] #[ORM\Table(name: 'chill_budget.charge')] @@ -39,7 +37,6 @@ class Charge extends AbstractElement implements HasCentersInterface self::HELP_NOT_RELEVANT, ]; - #[ORM\ManyToOne(targetEntity: ChargeKind::class, inversedBy: 'AbstractElement')] #[ORM\JoinColumn] private ?ChargeKind $charge = null; @@ -47,7 +44,6 @@ class Charge extends AbstractElement implements HasCentersInterface #[ORM\Column(name: 'help', type: \Doctrine\DBAL\Types\Types::STRING, nullable: true)] private ?string $help = self::HELP_NOT_RELEVANT; - #[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)] #[ORM\Id] #[ORM\GeneratedValue(strategy: 'AUTO')] diff --git a/src/Bundle/ChillBudgetBundle/Entity/ChargeKind.php b/src/Bundle/ChillBudgetBundle/Entity/ChargeKind.php index 7d8037802..dd63399e9 100644 --- a/src/Bundle/ChillBudgetBundle/Entity/ChargeKind.php +++ b/src/Bundle/ChillBudgetBundle/Entity/ChargeKind.php @@ -17,8 +17,6 @@ use Symfony\Component\Validator\Constraints as Assert; /** * Type of charge. - * - * */ #[UniqueEntity(fields: ['kind'])] #[ORM\Entity] @@ -26,7 +24,6 @@ use Symfony\Component\Validator\Constraints as Assert; #[ORM\UniqueConstraint(name: 'charge_kind_unique_type_idx', fields: ['kind'])] class ChargeKind { - #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER)] diff --git a/src/Bundle/ChillBudgetBundle/Entity/Resource.php b/src/Bundle/ChillBudgetBundle/Entity/Resource.php index c482424a8..14fa0c9fa 100644 --- a/src/Bundle/ChillBudgetBundle/Entity/Resource.php +++ b/src/Bundle/ChillBudgetBundle/Entity/Resource.php @@ -17,20 +17,16 @@ use Doctrine\ORM\Mapping as ORM; /** * Resource. - * - * */ #[ORM\Entity(repositoryClass: \Chill\BudgetBundle\Repository\ResourceRepository::class)] #[ORM\Table(name: 'chill_budget.resource')] class Resource extends AbstractElement implements HasCentersInterface { - #[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)] #[ORM\Id] #[ORM\GeneratedValue(strategy: 'AUTO')] private ?int $id = null; - #[ORM\ManyToOne(targetEntity: ResourceKind::class, inversedBy: 'AbstractElement')] #[ORM\JoinColumn] private ?ResourceKind $resource = null; diff --git a/src/Bundle/ChillBudgetBundle/Entity/ResourceKind.php b/src/Bundle/ChillBudgetBundle/Entity/ResourceKind.php index 30c1ac3d3..ec867a480 100644 --- a/src/Bundle/ChillBudgetBundle/Entity/ResourceKind.php +++ b/src/Bundle/ChillBudgetBundle/Entity/ResourceKind.php @@ -17,8 +17,6 @@ use Symfony\Component\Validator\Constraints as Assert; /** * Type of resource. - * - * */ #[UniqueEntity(fields: ['kind'])] #[ORM\UniqueConstraint(name: 'resource_kind_unique_type_idx', fields: ['kind'])] // @ORM\Entity @@ -28,7 +26,6 @@ use Symfony\Component\Validator\Constraints as Assert; #[ORM\Entity] // @ORM\Entity class ResourceKind { - #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER)] diff --git a/src/Bundle/ChillCalendarBundle/Entity/Calendar.php b/src/Bundle/ChillCalendarBundle/Entity/Calendar.php index 3fc89e87b..1ae1e966d 100644 --- a/src/Bundle/ChillCalendarBundle/Entity/Calendar.php +++ b/src/Bundle/ChillCalendarBundle/Entity/Calendar.php @@ -36,7 +36,6 @@ use Symfony\Component\Validator\Constraints\NotBlank; use Symfony\Component\Validator\Constraints\Range; use Symfony\Component\Validator\Mapping\ClassMetadata; - #[Serializer\DiscriminatorMap(typeProperty: 'type', mapping: ['chill_calendar_calendar' => Calendar::class])] #[ORM\Entity] #[ORM\Table(name: 'chill_calendar.calendar')] @@ -83,17 +82,17 @@ class Calendar implements TrackCreationInterface, TrackUpdateInterface, HasCente public ?User $previousMainUser = null; #[Serializer\Groups(['calendar:read', 'read'])] - #[ORM\ManyToOne(targetEntity: \Chill\PersonBundle\Entity\AccompanyingPeriod::class, inversedBy: 'calendars')] + #[ORM\ManyToOne(targetEntity: AccompanyingPeriod::class, inversedBy: 'calendars')] private ?AccompanyingPeriod $accompanyingPeriod = null; - #[ORM\ManyToOne(targetEntity: \Chill\ActivityBundle\Entity\Activity::class)] + #[ORM\ManyToOne(targetEntity: Activity::class)] private ?Activity $activity = null; #[Serializer\Groups(['calendar:read', 'read'])] - #[ORM\OneToOne(targetEntity: \CalendarRange::class, inversedBy: 'calendar')] + #[ORM\OneToOne(targetEntity: CalendarRange::class, inversedBy: 'calendar')] private ?CalendarRange $calendarRange = null; - #[ORM\ManyToOne(targetEntity: \CancelReason::class)] + #[ORM\ManyToOne(targetEntity: CancelReason::class)] private ?CancelReason $cancelReason = null; #[Serializer\Groups(['calendar:read', 'read', 'docgen:read'])] @@ -114,7 +113,6 @@ class Calendar implements TrackCreationInterface, TrackUpdateInterface, HasCente #[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATETIME_IMMUTABLE, nullable: false)] private ?\DateTimeImmutable $endDate = null; - #[Serializer\Groups(['calendar:read', 'read', 'calendar:light', 'docgen:read'])] #[ORM\Id] #[ORM\GeneratedValue] @@ -122,8 +120,6 @@ class Calendar implements TrackCreationInterface, TrackUpdateInterface, HasCente private ?int $id = null; /** - * - * * @var Collection&Selectable */ #[Serializer\Groups(['read', 'docgen:read'])] @@ -133,29 +129,25 @@ class Calendar implements TrackCreationInterface, TrackUpdateInterface, HasCente #[Serializer\Groups(['read', 'docgen:read'])] #[Assert\NotNull(message: 'calendar.A location is required')] - #[ORM\ManyToOne(targetEntity: \Chill\MainBundle\Entity\Location::class)] + #[ORM\ManyToOne(targetEntity: Location::class)] private ?Location $location = null; #[Serializer\Groups(['calendar:read', 'read', 'calendar:light', 'docgen:read'])] #[Assert\NotNull(message: 'calendar.A main user is mandatory')] - #[ORM\ManyToOne(targetEntity: \Chill\MainBundle\Entity\User::class)] + #[ORM\ManyToOne(targetEntity: User::class)] #[Serializer\Context(normalizationContext: ['read'], groups: ['calendar:light'])] private ?User $mainUser = null; - #[ORM\ManyToOne(targetEntity: Person::class)] #[ORM\JoinColumn(nullable: true)] private ?Person $person = null; /** - * - * - * * @var Collection */ #[Serializer\Groups(['calendar:read', 'read', 'calendar:light', 'docgen:read'])] #[Assert\Count(min: 1, minMessage: 'calendar.At least {{ limit }} person is required.')] - #[ORM\ManyToMany(targetEntity: \Chill\PersonBundle\Entity\Person::class, inversedBy: 'calendars')] + #[ORM\ManyToMany(targetEntity: Person::class, inversedBy: 'calendars')] #[ORM\JoinTable(name: 'chill_calendar.calendar_to_persons')] #[Serializer\Context(normalizationContext: ['read'], groups: ['calendar:light'])] private Collection $persons; @@ -166,11 +158,9 @@ class Calendar implements TrackCreationInterface, TrackUpdateInterface, HasCente /** * @var Collection - * - * */ #[Serializer\Groups(['calendar:read', 'read', 'calendar:light', 'docgen:read'])] - #[ORM\ManyToMany(targetEntity: \Chill\ThirdPartyBundle\Entity\ThirdParty::class)] + #[ORM\ManyToMany(targetEntity: ThirdParty::class)] #[ORM\JoinTable(name: 'chill_calendar.calendar_to_thirdparties')] #[Serializer\Context(normalizationContext: ['read'], groups: ['calendar:light'])] private Collection $professionals; diff --git a/src/Bundle/ChillCalendarBundle/Entity/CalendarDoc.php b/src/Bundle/ChillCalendarBundle/Entity/CalendarDoc.php index 00493787b..90143231e 100644 --- a/src/Bundle/ChillCalendarBundle/Entity/CalendarDoc.php +++ b/src/Bundle/ChillCalendarBundle/Entity/CalendarDoc.php @@ -20,7 +20,6 @@ use Chill\MainBundle\Doctrine\Model\TrackUpdateInterface; use Chill\MainBundle\Doctrine\Model\TrackUpdateTrait; use Doctrine\ORM\Mapping as ORM; - #[ORM\Entity] #[ORM\Table(name: 'chill_calendar.calendar_doc')] class CalendarDoc implements TrackCreationInterface, TrackUpdateInterface @@ -29,7 +28,6 @@ class CalendarDoc implements TrackCreationInterface, TrackUpdateInterface use TrackUpdateTrait; - #[ORM\ManyToOne(targetEntity: Calendar::class, inversedBy: 'documents')] #[ORM\JoinColumn(nullable: false)] private Calendar $calendar; @@ -37,7 +35,6 @@ class CalendarDoc implements TrackCreationInterface, TrackUpdateInterface #[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER, nullable: false, options: ['default' => 0])] private int $datetimeVersion = 0; - #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER)] @@ -46,11 +43,12 @@ class CalendarDoc implements TrackCreationInterface, TrackUpdateInterface #[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN, nullable: false, options: ['default' => false])] private bool $trackDateTimeVersion = false; - public function __construct(Calendar $calendar, + public function __construct( + Calendar $calendar, #[ORM\ManyToOne(targetEntity: StoredObject::class, cascade: ['persist'])] #[ORM\JoinColumn(nullable: false)] - private ?StoredObject $storedObject) - { + private ?StoredObject $storedObject + ) { $this->setCalendar($calendar); $this->datetimeVersion = $calendar->getDateTimeVersion(); } diff --git a/src/Bundle/ChillCalendarBundle/Entity/CalendarRange.php b/src/Bundle/ChillCalendarBundle/Entity/CalendarRange.php index 633a5c1f8..12f3ed7e7 100644 --- a/src/Bundle/ChillCalendarBundle/Entity/CalendarRange.php +++ b/src/Bundle/ChillCalendarBundle/Entity/CalendarRange.php @@ -21,7 +21,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_calendar.calendar_range')] #[ORM\UniqueConstraint(name: 'idx_calendar_range_remote', columns: ['remoteId'], options: ['where' => "remoteId <> ''"])] @@ -41,14 +40,12 @@ class CalendarRange implements TrackCreationInterface, TrackUpdateInterface #[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATETIME_IMMUTABLE, nullable: false)] private ?\DateTimeImmutable $endDate = null; - #[Groups(['read'])] #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER)] private ?int $id = null; - #[Groups(['read', 'write', 'calendar:read'])] #[Assert\NotNull] #[ORM\ManyToOne(targetEntity: Location::class)] @@ -62,7 +59,7 @@ class CalendarRange implements TrackCreationInterface, TrackUpdateInterface #[Groups(['read', 'write', 'calendar:read'])] #[Assert\NotNull] - #[ORM\ManyToOne(targetEntity: \Chill\MainBundle\Entity\User::class)] + #[ORM\ManyToOne(targetEntity: User::class)] private ?User $user = null; public function getCalendar(): ?Calendar diff --git a/src/Bundle/ChillCalendarBundle/Entity/CancelReason.php b/src/Bundle/ChillCalendarBundle/Entity/CancelReason.php index 75fb311fe..d4a2ed9a9 100644 --- a/src/Bundle/ChillCalendarBundle/Entity/CancelReason.php +++ b/src/Bundle/ChillCalendarBundle/Entity/CancelReason.php @@ -14,7 +14,6 @@ namespace Chill\CalendarBundle\Entity; use Chill\CalendarBundle\Repository\CancelReasonRepository; use Doctrine\ORM\Mapping as ORM; - #[ORM\Entity(repositoryClass: CancelReasonRepository::class)] #[ORM\Table(name: 'chill_calendar.cancel_reason')] class CancelReason @@ -31,7 +30,6 @@ class CancelReason #[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 255)] private ?string $canceledBy = null; - #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER)] diff --git a/src/Bundle/ChillCalendarBundle/Entity/Invite.php b/src/Bundle/ChillCalendarBundle/Entity/Invite.php index 25da8fcd3..3c1b2477d 100644 --- a/src/Bundle/ChillCalendarBundle/Entity/Invite.php +++ b/src/Bundle/ChillCalendarBundle/Entity/Invite.php @@ -24,8 +24,6 @@ use Symfony\Component\Serializer\Annotation as Serializer; * * The event/calendar in the user may have a different id than the mainUser. We add then fields to store the * remote id of this event in the remote calendar. - * - * */ #[ORM\Entity] #[ORM\Table(name: 'chill_calendar.invite')] @@ -59,7 +57,6 @@ class Invite implements TrackUpdateInterface, TrackCreationInterface #[ORM\ManyToOne(targetEntity: Calendar::class, inversedBy: 'invites')] private ?Calendar $calendar = null; - #[Serializer\Groups(groups: ['calendar:read', 'read'])] #[ORM\Id] #[ORM\GeneratedValue] @@ -70,9 +67,8 @@ class Invite implements TrackUpdateInterface, TrackCreationInterface #[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT, nullable: false, options: ['default' => 'pending'])] private string $status = self::PENDING; - #[Serializer\Groups(groups: ['calendar:read', 'read', 'docgen:read'])] - #[ORM\ManyToOne(targetEntity: \Chill\MainBundle\Entity\User::class)] + #[ORM\ManyToOne(targetEntity: User::class)] #[ORM\JoinColumn(nullable: false)] private ?User $user = null; diff --git a/src/Bundle/ChillCustomFieldsBundle/Entity/CustomField.php b/src/Bundle/ChillCustomFieldsBundle/Entity/CustomField.php index fa60f6b91..9fddc10b3 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Entity/CustomField.php +++ b/src/Bundle/ChillCustomFieldsBundle/Entity/CustomField.php @@ -15,9 +15,6 @@ use Doctrine\ORM\Mapping as ORM; /** * CustomField. - * - * - * */ #[ORM\Entity] #[ORM\HasLifecycleCallbacks] @@ -31,10 +28,9 @@ class CustomField #[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN)] private bool $active = true; - #[ORM\ManyToOne(targetEntity: \Chill\CustomFieldsBundle\Entity\CustomFieldsGroup::class, inversedBy: 'customFields')] + #[ORM\ManyToOne(targetEntity: CustomFieldsGroup::class, inversedBy: 'customFields')] private ?CustomFieldsGroup $customFieldGroup = null; - #[ORM\Id] #[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)] #[ORM\GeneratedValue(strategy: 'AUTO')] diff --git a/src/Bundle/ChillCustomFieldsBundle/Entity/CustomFieldLongChoice/Option.php b/src/Bundle/ChillCustomFieldsBundle/Entity/CustomFieldLongChoice/Option.php index 8afd96f81..497cf7150 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Entity/CustomFieldLongChoice/Option.php +++ b/src/Bundle/ChillCustomFieldsBundle/Entity/CustomFieldLongChoice/Option.php @@ -15,7 +15,6 @@ use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\Collection; use Doctrine\ORM\Mapping as ORM; - #[ORM\Entity(repositoryClass: \Chill\CustomFieldsBundle\EntityRepository\CustomFieldLongChoice\OptionRepository::class)] #[ORM\Table(name: 'custom_field_long_choice_options')] class Option @@ -26,10 +25,9 @@ class Option /** * @var Collection