Apply rector rules: add annotation for doctrine mapping

This commit is contained in:
Julien Fastré 2024-04-05 13:11:42 +02:00
parent a3f775a69b
commit 0ff4593863
Signed by: julienfastre
GPG Key ID: BDE2190974723FCB
118 changed files with 143 additions and 658 deletions

View File

@ -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<StoredObject>
*/
#[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<Person>
*/
#[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<ActivityReason>
*/
#[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<SocialAction>
*/
#[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<SocialIssue>
*/
#[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<ThirdParty>
*/
#[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<User>
*/
#[Groups(['read', 'docgen:read'])]
#[ORM\ManyToMany(targetEntity: \Chill\MainBundle\Entity\User::class)]
#[ORM\ManyToMany(targetEntity: User::class)]
private Collection $users;
public function __construct()

View File

@ -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 = [];
/**

View File

@ -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')]

View File

@ -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<ActivityReason>
*/
#[ORM\OneToMany(targetEntity: \Chill\ActivityBundle\Entity\ActivityReason::class, mappedBy: 'category')]
#[ORM\OneToMany(targetEntity: ActivityReason::class, mappedBy: 'category')]
private Collection $reasons;
/**

View File

@ -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'])]

View File

@ -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')]

View File

@ -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;

View File

@ -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;

View File

@ -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;
/**

View File

@ -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')]

View File

@ -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)]

View File

@ -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;

View File

@ -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)]

View File

@ -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<int, Invite>
*/
#[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<Person>
*/
#[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<ThirdParty>
*
*
*/
#[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;

View File

@ -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();
}

View File

@ -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

View File

@ -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)]

View File

@ -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;

View File

@ -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')]

View File

@ -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<Option>
*/
#[ORM\OneToMany(targetEntity: \Chill\CustomFieldsBundle\Entity\CustomFieldLongChoice\Option::class, mappedBy: 'parent')]
#[ORM\OneToMany(targetEntity: Option::class, mappedBy: 'parent')]
private Collection $children;
#[ORM\Id]
#[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)]
#[ORM\GeneratedValue(strategy: 'AUTO')]
@ -41,8 +39,7 @@ class Option
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 15)]
private ?string $key = null;
#[ORM\ManyToOne(targetEntity: \Chill\CustomFieldsBundle\Entity\CustomFieldLongChoice\Option::class, inversedBy: 'children')]
#[ORM\ManyToOne(targetEntity: Option::class, inversedBy: 'children')]
#[ORM\JoinColumn(nullable: true)]
private ?Option $parent = null;

View File

@ -15,21 +15,18 @@ use Doctrine\ORM\Mapping as ORM;
/**
* CustomFieldsDefaultGroup.
*
*
*/
#[ORM\Entity]
#[ORM\Table(name: 'customfieldsdefaultgroup')]
#[ORM\UniqueConstraint(name: 'unique_entity', columns: ['entity'])]
class CustomFieldsDefaultGroup
{
#[ORM\ManyToOne(targetEntity: \Chill\CustomFieldsBundle\Entity\CustomFieldsGroup::class)] // sf4 check: option inversedBy="customFields" return inconsistent error mapping !!
#[ORM\ManyToOne(targetEntity: CustomFieldsGroup::class)] // sf4 check: option inversedBy="customFields" return inconsistent error mapping !!
private ?CustomFieldsGroup $customFieldsGroup = null;
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 255)]
private ?string $entity = null;
#[ORM\Id]
#[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)]
#[ORM\GeneratedValue(strategy: 'AUTO')]

View File

@ -13,12 +13,11 @@ namespace Chill\CustomFieldsBundle\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\Common\Collections\Order;
use Doctrine\ORM\Mapping as ORM;
/**
* CustomFieldGroup.
*
*
*/
#[ORM\Entity]
#[ORM\Table(name: 'customfieldsgroup')]
@ -35,17 +34,14 @@ class CustomFieldsGroup
* The custom fields are asc-ordered regarding to their property "ordering".
*
* @var Collection<CustomField>
*
*
*/
#[ORM\OneToMany(targetEntity: \Chill\CustomFieldsBundle\Entity\CustomField::class, mappedBy: 'customFieldGroup')]
#[ORM\OrderBy(['ordering' => \Doctrine\Common\Collections\Criteria::ASC])]
#[ORM\OneToMany(targetEntity: CustomField::class, mappedBy: 'customFieldGroup')]
#[ORM\OrderBy(['ordering' => 'ASC'])]
private Collection $customFields;
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 255)]
private ?string $entity = null;
#[ORM\Id]
#[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)]
#[ORM\GeneratedValue(strategy: 'AUTO')]

View File

@ -15,7 +15,6 @@ use Chill\DocStoreBundle\Entity\StoredObject;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation as Serializer;
#[Serializer\DiscriminatorMap(typeProperty: 'type', mapping: ['docgen_template' => DocGeneratorTemplate::class])]
#[ORM\Entity]
#[ORM\Table(name: 'chill_docgen_template')]
@ -46,7 +45,6 @@ class DocGeneratorTemplate
#[ORM\ManyToOne(targetEntity: StoredObject::class, cascade: ['persist'])]
private ?StoredObject $file = null;
#[Serializer\Groups(['read'])]
#[ORM\Id]
#[ORM\GeneratedValue]

View File

@ -16,17 +16,14 @@ use Chill\MainBundle\Entity\HasScopesInterface;
use Chill\PersonBundle\Entity\AccompanyingPeriod;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity]
#[ORM\Table('chill_doc.accompanyingcourse_document')]
class AccompanyingCourseDocument extends Document implements HasScopesInterface, HasCentersInterface
{
#[ORM\ManyToOne(targetEntity: AccompanyingPeriod::class)]
#[ORM\JoinColumn(nullable: false)]
private ?AccompanyingPeriod $course = null;
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER)]

View File

@ -26,8 +26,7 @@ class Document implements TrackCreationInterface, TrackUpdateInterface
use TrackUpdateTrait;
#[ORM\ManyToOne(targetEntity: \Chill\DocStoreBundle\Entity\DocumentCategory::class)]
#[ORM\ManyToOne(targetEntity: DocumentCategory::class)]
#[ORM\JoinColumn(name: 'category_bundle_id', referencedColumnName: 'bundle_id')]
#[ORM\JoinColumn(name: 'category_id_inside_bundle', referencedColumnName: 'id_inside_bundle')]
private ?DocumentCategory $category = null;
@ -40,10 +39,10 @@ class Document implements TrackCreationInterface, TrackUpdateInterface
#[Assert\Valid]
#[Assert\NotNull(message: 'Upload a document')]
#[ORM\ManyToOne(targetEntity: \Chill\DocStoreBundle\Entity\StoredObject::class, cascade: ['persist'])]
#[ORM\ManyToOne(targetEntity: StoredObject::class, cascade: ['persist'])]
private ?StoredObject $object = null;
#[ORM\ManyToOne(targetEntity: \Chill\DocGeneratorBundle\Entity\DocGeneratorTemplate::class)]
#[ORM\ManyToOne(targetEntity: DocGeneratorTemplate::class)]
private ?DocGeneratorTemplate $template = null;
#[Assert\Length(min: 2, max: 250)]

View File

@ -13,7 +13,6 @@ namespace Chill\DocStoreBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity]
#[ORM\Table('chill_doc.document_category')]
class DocumentCategory
@ -33,16 +32,12 @@ class DocumentCategory
*/
public function __construct(
/**
*
*
* @var string The id of the bundle that has create the category (i.e. 'person', 'activity', ....)
*/
#[ORM\Id]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, name: 'bundle_id')]
private $bundleId,
/**
*
*
* @var int The id which is unique inside the bundle
*/
#[ORM\Id]

View File

@ -17,24 +17,22 @@ use Chill\MainBundle\Entity\Scope;
use Chill\PersonBundle\Entity\Person;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity]
#[ORM\Table('chill_doc.person_document')]
class PersonDocument extends Document implements HasCenterInterface, HasScopeInterface
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER)]
private ?int $id = null;
#[ORM\ManyToOne(targetEntity: \Chill\PersonBundle\Entity\Person::class)]
#[ORM\ManyToOne(targetEntity: Person::class)]
private Person $person;
/**
* @var Scope The document's center
*/
#[ORM\ManyToOne(targetEntity: \Chill\MainBundle\Entity\Scope::class)]
#[ORM\ManyToOne(targetEntity: Scope::class)]
private ?Scope $scope = null;
public function getCenter()

View File

@ -29,8 +29,6 @@ use Symfony\Component\Serializer\Annotation as Serializer;
* The property `$deleteAt` allow a deletion of the document after the given date. But this property should
* be set before the document is actually written by the StoredObjectManager.
*
*
*
* @AsyncFileExists(
* message="The file is not stored properly"
* )
@ -52,7 +50,6 @@ class StoredObject implements Document, TrackCreationInterface
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT)]
private string $filename = '';
#[Serializer\Groups(['read', 'write'])]
#[ORM\Id]
#[ORM\GeneratedValue]
@ -103,7 +100,8 @@ class StoredObject implements Document, TrackCreationInterface
/**
* @param StoredObject::STATUS_* $status
*/
public function __construct(#[Serializer\Groups(['read'])] #[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT, options: ['default' => 'ready'])]
public function __construct(
#[Serializer\Groups(['read'])] #[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT, options: ['default' => 'ready'])]
private string $status = 'ready'
) {
$this->uuid = Uuid::uuid4();

View File

@ -62,7 +62,7 @@ final class EventController extends AbstractController
) {}
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/event/event/{event_id}/delete', name: 'chill_event__event_delete', requirements: ['event_id' => '\d+'], methods: ['GET', 'DELETE'])]
public function deleteAction($event_id, Request $request): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response
public function deleteAction($event_id, Request $request): \Symfony\Component\HttpFoundation\RedirectResponse|Response
{
$em = $this->managerRegistry->getManager();
$event = $em->getRepository(Event::class)->findOneBy([
@ -110,7 +110,6 @@ final class EventController extends AbstractController
/**
* Displays a form to edit an existing Event entity.
*
*/
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/event/event/{event_id}/edit', name: 'chill_event__event_edit')]
public function editAction($event_id): Response
@ -134,8 +133,6 @@ final class EventController extends AbstractController
/**
* List events subscriptions for a person.
*
* @return \Symfony\Component\HttpFoundation\Response
*
* @throws \Doctrine\ORM\NonUniqueResultException
*/
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/event/event/{person_id}/list', name: 'chill_event__list_by_person', methods: ['GET'])]
@ -281,10 +278,9 @@ final class EventController extends AbstractController
*
* @ParamConverter("event", options={"id": "event_id"})
*
* @return \Symfony\Component\HttpFoundation\Response
* @return Response
*
* @throws \PhpOffice\PhpSpreadsheet\Exception
*
*/
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/event/event/{event_id}/show', name: 'chill_event__event_show')]
public function showAction(Event $event, Request $request)
@ -318,7 +314,7 @@ final class EventController extends AbstractController
* Edits an existing Event entity.
*/
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/event/event/{event_id}/update', name: 'chill_event__event_update', methods: ['POST', 'PUT'])]
public function updateAction(Request $request, $event_id): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response
public function updateAction(Request $request, $event_id): \Symfony\Component\HttpFoundation\RedirectResponse|Response
{
$em = $this->managerRegistry->getManager();

View File

@ -289,7 +289,6 @@ final class ParticipationController extends AbstractController
*
* @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException if the participation is not found
* @throws \Symfony\Component\HttpFoundation\File\Exception\AccessDeniedException if the user is not allowed to edit the participation
*
*/
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/event/participation/{participation_id}/edit', name: 'chill_event_participation_edit')]
public function editAction(int $participation_id): Response
@ -321,7 +320,6 @@ final class ParticipationController extends AbstractController
* show a form to edit multiple participation for the same event.
*
* @param int $event_id
*
*/
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/event/participation/{event_id}/edit_multiple', name: 'chill_event_participation_edit_multiple')]
public function editMultipleAction($event_id): Response|\Symfony\Component\HttpFoundation\RedirectResponse

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;
/**

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;

View File

@ -37,10 +37,10 @@ use Chill\PersonBundle\Validator\Constraints\AccompanyingPeriod\LocationValidity
use Chill\PersonBundle\Validator\Constraints\AccompanyingPeriod\ParticipationOverlap;
use Chill\PersonBundle\Validator\Constraints\AccompanyingPeriod\ResourceDuplicateCheck;
use Chill\ThirdPartyBundle\Entity\ThirdParty;
use DateTime;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\Common\Collections\Criteria;
use Doctrine\Common\Collections\Order;
use Doctrine\Common\Collections\ReadableCollection;
use Doctrine\Common\Collections\Selectable;
use Doctrine\ORM\Mapping as ORM;
@ -54,8 +54,6 @@ use UnexpectedValueException;
/**
* AccompanyingPeriod Class.
*
*
*
* @AccompanyingPeriodValidity(groups={AccompanyingPeriod::STEP_DRAFT, AccompanyingPeriod::STEP_CONFIRMED})
*
* @LocationValidity(groups={AccompanyingPeriod::STEP_DRAFT, AccompanyingPeriod::STEP_CONFIRMED})
@ -136,13 +134,13 @@ class AccompanyingPeriod implements
#[Groups(['read', 'write'])]
#[Assert\NotBlank(groups: [AccompanyingPeriod::STEP_CONFIRMED])]
#[ORM\ManyToOne(targetEntity: \Chill\MainBundle\Entity\Location::class)]
#[ORM\ManyToOne(targetEntity: Location::class)]
private ?Location $administrativeLocation = null;
/**
* @var Collection&Selectable<int, Calendar>
*/
#[ORM\OneToMany(targetEntity: \Chill\CalendarBundle\Entity\Calendar::class, mappedBy: 'accompanyingPeriod')]
#[ORM\OneToMany(targetEntity: Calendar::class, mappedBy: 'accompanyingPeriod')]
private Collection&Selectable $calendars;
#[Groups(['read', 'write', 'docgen:read'])]
@ -151,21 +149,18 @@ class AccompanyingPeriod implements
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATE_MUTABLE, nullable: true)]
private ?\DateTime $closingDate = null;
#[Groups(['read', 'write'])]
#[Assert\NotBlank(groups: [AccompanyingPeriod::STEP_CLOSED])]
#[ORM\ManyToOne(targetEntity: \Chill\PersonBundle\Entity\AccompanyingPeriod\ClosingMotive::class)]
#[ORM\ManyToOne(targetEntity: ClosingMotive::class)]
#[ORM\JoinColumn(nullable: true)]
private ?ClosingMotive $closingMotive = null;
/**
*
*
* @var Collection<Comment>
*/
#[Assert\NotBlank(groups: [AccompanyingPeriod::STEP_DRAFT])]
#[ORM\OneToMany(targetEntity: \Chill\PersonBundle\Entity\AccompanyingPeriod\Comment::class, mappedBy: 'accompanyingPeriod', cascade: ['persist', 'remove'], orphanRemoval: true)]
#[ORM\OrderBy(['createdAt' => \Doctrine\Common\Collections\Criteria::DESC, 'id' => 'DESC'])]
#[ORM\OneToMany(targetEntity: Comment::class, mappedBy: 'accompanyingPeriod', cascade: ['persist', 'remove'], orphanRemoval: true)]
#[ORM\OrderBy(['createdAt' => Order::Descending, 'id' => 'DESC'])]
private Collection $comments;
#[Groups(['read', 'write', 'docgen:read'])]
@ -176,7 +171,6 @@ class AccompanyingPeriod implements
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATETIME_MUTABLE, nullable: true, options: ['default' => null])]
private ?\DateTimeInterface $createdAt = null;
#[Groups(['read', 'docgen:read'])]
#[ORM\ManyToOne(targetEntity: User::class)]
#[ORM\JoinColumn(nullable: true)]
@ -186,7 +180,6 @@ class AccompanyingPeriod implements
#[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)]
@ -215,7 +208,6 @@ class AccompanyingPeriod implements
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATE_MUTABLE)]
private ?\DateTime $openingDate = null;
#[Groups(['read', 'write'])]
#[Assert\NotBlank(groups: [AccompanyingPeriod::STEP_CONFIRMED])]
#[ORM\ManyToOne(targetEntity: Origin::class)]
@ -223,8 +215,8 @@ class AccompanyingPeriod implements
private ?Origin $origin = null;
/**
*
* @ParticipationOverlap(groups={AccompanyingPeriod::STEP_DRAFT, AccompanyingPeriod::STEP_CONFIRMED})
*
* @var Collection<AccompanyingPeriodParticipation>
*/
#[Groups(['read', 'docgen:read'])]
@ -234,7 +226,6 @@ class AccompanyingPeriod implements
#[ORM\ManyToOne(targetEntity: Person::class, inversedBy: 'periodLocatedOn')]
private ?Person $personLocation = null;
#[Groups(['read'])]
#[ORM\ManyToOne(targetEntity: Comment::class, cascade: ['persist'])]
#[ORM\JoinColumn(onDelete: 'SET NULL')]
@ -250,12 +241,10 @@ class AccompanyingPeriod implements
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN, options: ['default' => false])]
private bool $requestorAnonymous = false;
#[ORM\ManyToOne(targetEntity: Person::class, inversedBy: 'accompanyingPeriodRequested')]
#[ORM\JoinColumn(nullable: true)]
private ?Person $requestorPerson = null;
#[ORM\ManyToOne(targetEntity: ThirdParty::class)]
#[ORM\JoinColumn(nullable: true)]
private ?ThirdParty $requestorThirdParty = null;
@ -263,17 +252,14 @@ class AccompanyingPeriod implements
/**
* @var Collection<resource>
*
*
* @ResourceDuplicateCheck(groups={AccompanyingPeriod::STEP_DRAFT, AccompanyingPeriod::STEP_CONFIRMED, "Default", "default"})
*/
#[Groups(['read', 'docgen:read'])]
#[ORM\OneToMany(targetEntity: \Chill\PersonBundle\Entity\AccompanyingPeriod\Resource::class, mappedBy: 'accompanyingPeriod', cascade: ['persist', 'remove'], orphanRemoval: true)]
#[ORM\OneToMany(targetEntity: AccompanyingPeriod\Resource::class, mappedBy: 'accompanyingPeriod', cascade: ['persist', 'remove'], orphanRemoval: true)]
private Collection $resources;
/**
* @var Collection<Scope>
*
*
*/
#[Groups(['read', 'docgen:read'])]
#[Assert\Count(min: 1, groups: [AccompanyingPeriod::STEP_CONFIRMED], minMessage: 'A course must be associated to at least one scope')]
@ -283,8 +269,6 @@ class AccompanyingPeriod implements
/**
* @var Collection<SocialIssue>
*
*
*/
#[Groups(['read', 'docgen:read'])]
#[Assert\Count(min: 1, groups: [AccompanyingPeriod::STEP_CONFIRMED], minMessage: 'A course must contains at least one social issue')]
@ -311,7 +295,6 @@ class AccompanyingPeriod implements
#[ORM\ManyToOne(targetEntity: User::class)]
private ?User $updatedBy = null;
#[Groups(['read', 'write', 'docgen:read'])]
#[ORM\ManyToOne(targetEntity: User::class)]
#[ORM\JoinColumn(nullable: true)]
@ -420,7 +403,7 @@ class AccompanyingPeriod implements
// ensure continuity of histories
$criteria = new Criteria();
$criteria->orderBy(['startDate' => \Doctrine\Common\Collections\Order::Ascending, 'id' => \Doctrine\Common\Collections\Order::Ascending]);
$criteria->orderBy(['startDate' => Order::Ascending, 'id' => Order::Ascending]);
/** @var \Iterator $locations */
$locations = $this->getLocationHistories()->matching($criteria)->getIterator();
@ -1383,7 +1366,7 @@ class AccompanyingPeriod implements
{
// ensure continuity of histories
$criteria = new Criteria();
$criteria->orderBy(['startDate' => \Doctrine\Common\Collections\Order::Ascending, 'id' => \Doctrine\Common\Collections\Order::Ascending]);
$criteria->orderBy(['startDate' => Order::Ascending, 'id' => Order::Ascending]);
/** @var \Iterator $steps */
$steps = $this->getStepHistories()->matching($criteria)->getIterator();

View File

@ -24,8 +24,6 @@ use Doctrine\ORM\Mapping as ORM;
* Usage:
*
* - get the user involved with an accompanying period
*
*
*/
#[ORM\Entity]
#[ORM\Table(name: 'view_chill_person_accompanying_period_info')]
@ -40,8 +38,6 @@ class AccompanyingPeriodInfo
/**
* @var string
*
*
*/
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT)]
#[ORM\Id]
@ -49,8 +45,6 @@ class AccompanyingPeriodInfo
/**
* @var int
*
*
*/
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER)]
#[ORM\Id]

View File

@ -18,7 +18,6 @@ use Chill\PersonBundle\Entity\AccompanyingPeriod;
use Chill\PersonBundle\Entity\Person;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity]
#[ORM\Table('chill_person_accompanying_period_location_history')]
class AccompanyingPeriodLocationHistory implements TrackCreationInterface
@ -31,7 +30,6 @@ class AccompanyingPeriodLocationHistory implements TrackCreationInterface
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATE_IMMUTABLE, nullable: true, options: ['default' => null])]
private ?\DateTimeImmutable $endDate = null;
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER)]

View File

@ -16,10 +16,8 @@ use Chill\MainBundle\Doctrine\Model\TrackCreationTrait;
use Chill\MainBundle\Doctrine\Model\TrackUpdateInterface;
use Chill\MainBundle\Doctrine\Model\TrackUpdateTrait;
use Chill\PersonBundle\Entity\AccompanyingPeriod;
use Chill\PersonBundle\Entity\Person;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity]
#[ORM\Table('chill_person_accompanying_period_step_history')]
class AccompanyingPeriodStepHistory implements TrackCreationInterface, TrackUpdateInterface
@ -31,7 +29,6 @@ class AccompanyingPeriodStepHistory implements TrackCreationInterface, TrackUpda
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATE_IMMUTABLE, nullable: true, options: ['default' => null])]
private ?\DateTimeImmutable $endDate = null;
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER)]
@ -46,7 +43,6 @@ class AccompanyingPeriodStepHistory implements TrackCreationInterface, TrackUpda
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT, nullable: false)]
private string $step;
#[ORM\ManyToOne(targetEntity: ClosingMotive::class)]
#[ORM\JoinColumn(nullable: true)]
private ?ClosingMotive $closingMotive = null;

View File

@ -24,12 +24,12 @@ use Chill\PersonBundle\Entity\SocialWork\SocialIssue;
use Chill\ThirdPartyBundle\Entity\ThirdParty;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\Common\Collections\Order;
use Doctrine\Common\Collections\ReadableCollection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation as Serializer;
use Symfony\Component\Validator\Constraints as Assert;
#[Serializer\DiscriminatorMap(typeProperty: 'type', mapping: ['accompanying_period_work' => AccompanyingPeriodWork::class])]
#[ORM\Entity]
#[ORM\Table(name: 'chill_person_accompanying_period_work')]
@ -41,15 +41,13 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues
private ?AccompanyingPeriod $accompanyingPeriod = null;
/**
*
*
* @var Collection<AccompanyingPeriodWorkEvaluation>
*
* @internal /!\ the serialization for write evaluations is handled in `AccompanyingPeriodWorkDenormalizer`
*/
#[Serializer\Groups(['read', 'docgen:read'])]
#[ORM\OneToMany(targetEntity: AccompanyingPeriodWorkEvaluation::class, mappedBy: 'accompanyingPeriodWork', cascade: ['remove', 'persist'], orphanRemoval: true)]
#[ORM\OrderBy(['startDate' => \Doctrine\Common\Collections\Criteria::DESC, 'id' => 'DESC'])]
#[ORM\OrderBy(['startDate' => 'DESC', 'id' => 'DESC'])]
private Collection $accompanyingPeriodWorkEvaluations;
#[Serializer\Groups(['read', 'docgen:read', 'read:accompanyingPeriodWork:light'])]
@ -64,7 +62,6 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT)]
private string $createdAutomaticallyReason = '';
#[Serializer\Groups(['read', 'docgen:read', 'read:accompanyingPeriodWork:light'])]
#[ORM\ManyToOne(targetEntity: User::class)]
#[ORM\JoinColumn(nullable: false)]
@ -86,7 +83,6 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues
#[ORM\ManyToOne(targetEntity: ThirdParty::class)]
private ?ThirdParty $handlingThierParty = null;
#[Serializer\Groups(['read', 'docgen:read', 'read:accompanyingPeriodWork:light', 'read:evaluation:include-work'])]
#[ORM\Id]
#[ORM\GeneratedValue]
@ -99,8 +95,6 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues
/**
* @var Collection<Person>
*
*
*/
#[Serializer\Groups(['read', 'docgen:read', 'read:accompanyingPeriodWork:light', 'accompanying_period_work:edit', 'accompanying_period_work:create'])]
#[ORM\ManyToMany(targetEntity: Person::class)]
@ -108,7 +102,7 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues
private Collection $persons;
#[Serializer\Groups(['read', 'accompanying_period_work:edit'])]
#[ORM\Embedded(class: \Chill\MainBundle\Entity\Embeddable\PrivateCommentEmbeddable::class, columnPrefix: 'privateComment_')]
#[ORM\Embedded(class: PrivateCommentEmbeddable::class, columnPrefix: 'privateComment_')]
private PrivateCommentEmbeddable $privateComment;
/**
@ -119,8 +113,6 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues
/**
* @var Collection<Result>
*
*
*/
#[Serializer\Groups(['read', 'docgen:read', 'accompanying_period_work:edit'])]
#[ORM\ManyToMany(targetEntity: Result::class, inversedBy: 'accompanyingPeriodWorks')]
@ -138,8 +130,6 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues
/**
* @var Collection<ThirdParty>
*
*
*/
#[Serializer\Groups(['read', 'docgen:read', 'accompanying_period_work:edit'])]
#[ORM\ManyToMany(targetEntity: ThirdParty::class)]
@ -150,13 +140,11 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATETIME_IMMUTABLE)]
private ?\DateTimeImmutable $updatedAt = null;
#[Serializer\Groups(['read', 'docgen:read'])]
#[ORM\ManyToOne(targetEntity: User::class)]
#[ORM\JoinColumn(nullable: false)]
private ?User $updatedBy = null;
#[Serializer\Groups(['read', 'accompanying_period_work:edit'])]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER, nullable: false, options: ['default' => 1])]
#[ORM\Version]

View File

@ -15,13 +15,11 @@ use Chill\MainBundle\Doctrine\Model\TrackCreationInterface;
use Chill\MainBundle\Doctrine\Model\TrackUpdateInterface;
use Chill\MainBundle\Entity\User;
use Chill\PersonBundle\Entity\SocialWork\Evaluation;
use DateInterval;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation as Serializer;
#[Serializer\DiscriminatorMap(typeProperty: 'type', mapping: ['accompanying_period_work_evaluation' => AccompanyingPeriodWorkEvaluation::class])]
#[ORM\Entity]
#[ORM\Table('chill_person_accompanying_period_work_evaluation')]
@ -49,8 +47,6 @@ class AccompanyingPeriodWorkEvaluation implements TrackCreationInterface, TrackU
*
* @see{Chill\PersonBundle\Serializer\Normalizer\AccompanyingPeriodWorkEvaluationDenormalizer}
*
*
*
* @var Collection<AccompanyingPeriodWorkEvaluationDocument>
*/
#[Serializer\Groups(['read'])]
@ -66,7 +62,6 @@ class AccompanyingPeriodWorkEvaluation implements TrackCreationInterface, TrackU
#[ORM\ManyToOne(targetEntity: Evaluation::class)]
private ?Evaluation $evaluation = null;
#[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 as Serializer;
use Symfony\Component\Validator\Constraints as Assert;
#[Serializer\DiscriminatorMap(typeProperty: 'type', mapping: ['accompanying_period_work_evaluation_document' => AccompanyingPeriodWorkEvaluationDocument::class])]
#[ORM\Entity]
#[ORM\Table('chill_person_accompanying_period_work_evaluation_document')]
@ -33,11 +32,7 @@ class AccompanyingPeriodWorkEvaluationDocument implements \Chill\MainBundle\Doct
private ?AccompanyingPeriodWorkEvaluation $accompanyingPeriodWorkEvaluation = null;
/**
*
*
*
* @internal the default name exceeds 64 characters, we must set manually:
*
*/
#[Serializer\Groups(['read', 'accompanying_period_work_evaluation:create'])]
#[ORM\Id]

View File

@ -18,7 +18,6 @@ use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation as Serializer;
#[Serializer\DiscriminatorMap(typeProperty: 'type', mapping: ['accompanying_period_work_goal' => AccompanyingPeriodWorkGoal::class])]
#[ORM\Entity]
#[ORM\Table(name: 'chill_person_accompanying_period_work_goal')]
@ -31,7 +30,6 @@ class AccompanyingPeriodWorkGoal
#[ORM\ManyToOne(targetEntity: Goal::class)]
private ?Goal $goal = null;
#[Serializer\Groups(['read', 'docgen:read'])]
#[ORM\Id]
#[ORM\GeneratedValue]
@ -44,8 +42,6 @@ class AccompanyingPeriodWorkGoal
/**
* @var Collection<Result>
*
*
*/
#[Serializer\Groups(['accompanying_period_work:edit', 'read', 'docgen:read'])]
#[ORM\ManyToMany(targetEntity: Result::class, inversedBy: 'accompanyingPeriodWorkGoals')]

View File

@ -18,7 +18,6 @@ use Chill\MainBundle\Doctrine\Model\TrackUpdateTrait;
use Chill\MainBundle\Entity\User;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity]
#[ORM\Table(name: 'chill_person_accompanying_period_work_referrer')]
class AccompanyingPeriodWorkReferrerHistory implements TrackCreationInterface, TrackUpdateInterface
@ -26,7 +25,6 @@ class AccompanyingPeriodWorkReferrerHistory implements TrackCreationInterface, T
use TrackCreationTrait;
use TrackUpdateTrait;
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER)]

View File

@ -18,8 +18,6 @@ use Symfony\Component\Serializer\Annotation as Serializer;
/**
* ClosingMotive give an explanation why we closed the Accompanying period.
*
*
*/
#[ORM\Entity]
#[ORM\Table(name: 'chill_person_accompanying_period_closingmotive')]
@ -33,10 +31,9 @@ class ClosingMotive
*
* @var Collection<ClosingMotive>
*/
#[ORM\OneToMany(targetEntity: \Chill\PersonBundle\Entity\AccompanyingPeriod\ClosingMotive::class, mappedBy: 'parent')]
#[ORM\OneToMany(targetEntity: ClosingMotive::class, mappedBy: 'parent')]
private Collection $children;
#[Serializer\Groups(['docgen:read'])]
#[ORM\Id]
#[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)]
@ -51,7 +48,7 @@ class ClosingMotive
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::FLOAT)]
private float $ordering = 0.0;
#[ORM\ManyToOne(targetEntity: \Chill\PersonBundle\Entity\AccompanyingPeriod\ClosingMotive::class, inversedBy: 'children')]
#[ORM\ManyToOne(targetEntity: ClosingMotive::class, inversedBy: 'children')]
private ?ClosingMotive $parent = null;
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN, nullable: false, options: ['default' => false])]

View File

@ -20,14 +20,12 @@ use Symfony\Component\Serializer\Annotation\DiscriminatorMap;
use Symfony\Component\Serializer\Annotation\Groups;
use Symfony\Component\Validator\Constraints as Assert;
#[DiscriminatorMap(typeProperty: 'type', mapping: ['accompanying_period_comment' => Comment::class])]
#[ORM\Entity]
#[ORM\Table(name: 'chill_person_accompanying_period_comment')]
class Comment implements TrackCreationInterface, TrackUpdateInterface
{
#[ORM\ManyToOne(targetEntity: \Chill\PersonBundle\Entity\AccompanyingPeriod::class, inversedBy: 'comments')]
#[ORM\ManyToOne(targetEntity: AccompanyingPeriod::class, inversedBy: 'comments')]
#[ORM\JoinColumn(nullable: false, onDelete: 'CASCADE')]
private ?AccompanyingPeriod $accompanyingPeriod = null;
@ -41,13 +39,11 @@ class Comment implements TrackCreationInterface, TrackUpdateInterface
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATETIME_MUTABLE)]
private ?\DateTimeInterface $createdAt = null;
#[Groups(['read', 'docgen:read'])]
#[ORM\ManyToOne(targetEntity: User::class)]
#[ORM\JoinColumn(nullable: false)]
private ?User $creator = null;
#[Groups(['read', 'docgen:read'])]
#[ORM\Id]
#[ORM\GeneratedValue]
@ -58,7 +54,6 @@ class Comment implements TrackCreationInterface, TrackUpdateInterface
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATETIME_MUTABLE)]
private ?\DateTimeInterface $updatedAt = null;
#[Groups(['read'])]
#[ORM\ManyToOne(targetEntity: User::class)]
#[ORM\JoinColumn(nullable: false)]

View File

@ -14,13 +14,11 @@ namespace Chill\PersonBundle\Entity\AccompanyingPeriod;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation as Serializer;
#[Serializer\DiscriminatorMap(typeProperty: 'type', mapping: ['origin' => Origin::class])]
#[ORM\Entity]
#[ORM\Table(name: 'chill_person_accompanying_period_origin')]
class Origin
{
#[Serializer\Groups(['read', 'docgen:read'])]
#[ORM\Id]
#[ORM\GeneratedValue]

View File

@ -20,9 +20,6 @@ use Symfony\Component\Serializer\Annotation\Groups;
/**
* **About denormalization**: this operation is operated by @see{AccompanyingPeriodResourdeNormalizer}.
*
*
*
*/
#[DiscriminatorMap(typeProperty: 'type', mapping: ['accompanying_period_resource' => Resource::class])]
#[ORM\Entity]
@ -33,8 +30,7 @@ use Symfony\Component\Serializer\Annotation\Groups;
#[ORM\UniqueConstraint(name: 'thirdparty_unique', columns: ['thirdparty_id', 'accompanyingperiod_id'])]
class Resource
{
#[ORM\ManyToOne(targetEntity: \Chill\PersonBundle\Entity\AccompanyingPeriod::class, inversedBy: 'resources')]
#[ORM\ManyToOne(targetEntity: AccompanyingPeriod::class, inversedBy: 'resources')]
#[ORM\JoinColumn(nullable: false)]
private ?AccompanyingPeriod $accompanyingPeriod = null;
@ -42,20 +38,17 @@ class Resource
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT, nullable: true)]
private ?string $comment = '';
#[Groups(['read', 'docgen:read'])]
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER)]
private ?int $id = null;
#[Groups(['docgen:read'])]
#[ORM\ManyToOne(targetEntity: Person::class)]
#[ORM\JoinColumn(nullable: true)]
private ?Person $person = null;
#[Groups(['docgen:read'])]
#[ORM\ManyToOne(targetEntity: ThirdParty::class)]
#[ORM\JoinColumn(nullable: true)]

View File

@ -17,7 +17,6 @@ use Chill\MainBundle\Entity\User;
use Chill\PersonBundle\Entity\AccompanyingPeriod;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity]
#[ORM\Table('chill_person_accompanying_period_user_history')]
class UserHistory implements TrackCreationInterface
@ -27,22 +26,18 @@ class UserHistory implements TrackCreationInterface
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATETIME_IMMUTABLE, nullable: true, options: ['default' => null])]
private ?\DateTimeImmutable $endDate = null;
#[ORM\Id]
#[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)]
#[ORM\GeneratedValue(strategy: 'AUTO')]
private ?int $id = null;
public function __construct(
#[ORM\ManyToOne(targetEntity: AccompanyingPeriod::class, inversedBy: 'userHistories')]
#[ORM\JoinColumn(nullable: false)]
private ?AccompanyingPeriod $accompanyingPeriod,
#[ORM\ManyToOne(targetEntity: User::class)]
#[ORM\JoinColumn(nullable: false)]
private User $user,
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATETIME_IMMUTABLE, nullable: false, options: ['default' => 'now()'])]
private \DateTimeImmutable $startDate = new \DateTimeImmutable('now')
) {}

View File

@ -17,8 +17,6 @@ use Symfony\Component\Serializer\Annotation\Groups;
/**
* AccompanyingPeriodParticipation Class.
*
*
*/
#[DiscriminatorMap(typeProperty: 'type', mapping: ['accompanying_period_participation' => AccompanyingPeriodParticipation::class])]
#[ORM\Entity]
@ -29,7 +27,6 @@ class AccompanyingPeriodParticipation
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATE_MUTABLE, nullable: true)]
private ?\DateTime $endDate = null;
#[Groups(['read', 'docgen:read'])]
#[ORM\Id]
#[ORM\GeneratedValue]
@ -43,7 +40,7 @@ class AccompanyingPeriodParticipation
public function __construct(
#[ORM\ManyToOne(targetEntity: AccompanyingPeriod::class, inversedBy: 'participations', cascade: ['persist'])]
#[ORM\JoinColumn(name: 'accompanyingperiod_id', referencedColumnName: 'id', nullable: false)]
private ?AccompanyingPeriod $accompanyingPeriod,
private ?AccompanyingPeriod $accompanyingPeriod,
#[Groups(['read', 'docgen:read'])] #[ORM\ManyToOne(targetEntity: Person::class, inversedBy: 'accompanyingPeriodParticipations')] #[ORM\JoinColumn(name: 'person_id', referencedColumnName: 'id', nullable: false)]
private ?Person $person
) {

View File

@ -26,8 +26,6 @@ use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Component\Validator\Context\ExecutionContextInterface;
/**
*
*
* @MaxHolder(groups={"household_memberships"})
*/
#[Serializer\DiscriminatorMap(typeProperty: 'type', mapping: ['household' => Household::class])]
@ -39,14 +37,11 @@ class Household
* Addresses.
*
* @var Collection<Address>
*
*
*
*/
#[Serializer\Groups(['write'])]
#[ORM\ManyToMany(targetEntity: \Chill\MainBundle\Entity\Address::class, cascade: ['persist', 'remove', 'merge', 'detach'])]
#[ORM\ManyToMany(targetEntity: Address::class, cascade: ['persist', 'remove', 'merge', 'detach'])]
#[ORM\JoinTable(name: 'chill_person_household_to_addresses')]
#[ORM\OrderBy(['validFrom' => \Doctrine\Common\Collections\Criteria::DESC, 'id' => 'DESC'])]
#[ORM\OrderBy(['validFrom' => Criteria::DESC, 'id' => 'DESC'])]
private Collection $addresses;
#[ORM\Embedded(class: CommentEmbeddable::class, columnPrefix: 'comment_members_')]
@ -54,15 +49,12 @@ class Household
/**
* @var Collection&Selectable<int, HouseholdComposition>
*
*
*/
#[Assert\Valid(traverse: true, groups: ['household_composition'])]
#[ORM\OneToMany(targetEntity: HouseholdComposition::class, mappedBy: 'household', orphanRemoval: true, cascade: ['persist'])]
#[ORM\OrderBy(['startDate' => \Doctrine\Common\Collections\Criteria::DESC])]
#[ORM\OrderBy(['startDate' => Criteria::DESC])]
private Collection&Selectable $compositions;
#[Serializer\Groups(['read', 'docgen:read'])]
#[ORM\Id]
#[ORM\GeneratedValue]

View File

@ -20,7 +20,6 @@ use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation as Serializer;
use Symfony\Component\Validator\Constraints as Assert;
#[Serializer\DiscriminatorMap(typeProperty: 'type', mapping: ['household_composition_type' => HouseholdCompositionType::class])]
#[ORM\Entity]
#[ORM\Table(name: 'chill_person_household_composition')]
@ -38,18 +37,15 @@ class HouseholdComposition implements TrackCreationInterface, TrackUpdateInterfa
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATE_IMMUTABLE, nullable: true, options: ['default' => null])]
private ?\DateTimeImmutable $endDate = null;
#[ORM\ManyToOne(targetEntity: Household::class, inversedBy: 'compositions')]
#[ORM\JoinColumn(nullable: false)]
private ?Household $household = null;
#[Serializer\Groups(['docgen:read'])]
#[ORM\ManyToOne(targetEntity: HouseholdCompositionType::class)]
#[ORM\JoinColumn(nullable: false)]
private ?HouseholdCompositionType $householdCompositionType = null;
#[Serializer\Groups(['read', 'docgen:read'])]
#[ORM\Id]
#[ORM\GeneratedValue]

View File

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

View File

@ -16,7 +16,6 @@ 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_person_household_members')]
class HouseholdMember
@ -39,7 +38,6 @@ class HouseholdMember
#[ORM\ManyToOne(targetEntity: Household::class)]
private ?Household $household = null;
#[Serializer\Groups(['read', 'docgen:read'])]
#[ORM\Id]
#[ORM\GeneratedValue]

View File

@ -38,26 +38,21 @@ use Doctrine\ORM\Mapping as ORM;
* 1. 1st entity: from 2021-01-01 to 2021-06-01, household W, address Q;
* 2. 2st entity: from 2021-06-01 to 2021-12-01, household W, address R;
* 3. 3st entity: from 2021-12-01 to NULL, household V, address T;
*
*
*/
#[ORM\Entity(readOnly: true)]
#[ORM\Table(name: 'view_chill_person_household_address')]
class PersonHouseholdAddress
{
#[ORM\Id]
#[ORM\ManyToOne(targetEntity: Address::class)]
#[ORM\JoinColumn(nullable: false)]
private ?Address $address = null;
#[ORM\Id]
#[ORM\ManyToOne(targetEntity: Household::class)]
#[ORM\JoinColumn(nullable: false)]
private ?Household $household = null;
#[ORM\Id]
#[ORM\ManyToOne(targetEntity: Person::class)]
#[ORM\JoinColumn(nullable: false)]

View File

@ -14,7 +14,6 @@ namespace Chill\PersonBundle\Entity\Household;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation as Serializer;
#[Serializer\DiscriminatorMap(typeProperty: 'type', mapping: ['household_position' => Position::class])]
#[ORM\Entity]
#[ORM\Table(name: 'chill_person_household_position')]
@ -24,7 +23,6 @@ class Position
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN)]
private bool $allowHolder = false;
#[Serializer\Groups(['read', 'docgen:read'])]
#[ORM\Id]
#[ORM\GeneratedValue]

View File

@ -15,16 +15,12 @@ use Doctrine\ORM\Mapping as ORM;
/**
* MaritalStatus.
*
*
*
*/
#[ORM\Entity]
#[ORM\HasLifecycleCallbacks]
#[ORM\Table(name: 'chill_person_marital_status')]
class MaritalStatus
{
#[ORM\Id]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 7)]
private ?string $id;

View File

@ -48,13 +48,8 @@ use Symfony\Component\Validator\Context\ExecutionContextInterface;
/**
* Person Class.
*
*
*
*
*
*
*
* @PersonHasCenter
*
* @HouseholdMembershipSequential(
* groups={"household_memberships"}
* )
@ -96,17 +91,14 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
* The person's accompanying periods (when the person was accompanied by the center).
*
* @var Collection<AccompanyingPeriodParticipation>
*
*
*/
#[ORM\OneToMany(targetEntity: AccompanyingPeriodParticipation::class, mappedBy: 'person', cascade: ['persist', 'remove', 'merge', 'detach'])]
#[ORM\OrderBy(['startDate' => \Doctrine\Common\Collections\Criteria::DESC])]
#[ORM\OrderBy(['startDate' => Criteria::DESC])]
private Collection $accompanyingPeriodParticipations;
/**
* The accompanying period requested by the Person.
*
*
* @var Collection<AccompanyingPeriod>
*/
#[ORM\OneToMany(targetEntity: AccompanyingPeriod::class, mappedBy: 'requestorPerson')]
@ -116,25 +108,21 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
* Addresses.
*
* @var Collection<Address>
*
*
*
*/
#[ORM\ManyToMany(targetEntity: \Chill\MainBundle\Entity\Address::class, cascade: ['persist', 'remove', 'merge', 'detach'])]
#[ORM\ManyToMany(targetEntity: Address::class, cascade: ['persist', 'remove', 'merge', 'detach'])]
#[ORM\JoinTable(name: 'chill_person_persons_to_addresses')]
#[ORM\OrderBy(['validFrom' => \Doctrine\Common\Collections\Criteria::DESC])]
#[ORM\OrderBy(['validFrom' => Criteria::DESC])]
private Collection $addresses;
/**
* @var Collection<PersonAltName>
*/
#[ORM\OneToMany(targetEntity: \Chill\PersonBundle\Entity\PersonAltName::class, mappedBy: 'person', cascade: ['persist', 'remove', 'merge', 'detach'], orphanRemoval: true)]
#[ORM\OneToMany(targetEntity: PersonAltName::class, mappedBy: 'person', cascade: ['persist', 'remove', 'merge', 'detach'], orphanRemoval: true)]
private Collection $altNames;
/**
* The person's birthdate.
*
*
* @Birthdate
*/
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATE_MUTABLE, nullable: true)]
@ -155,16 +143,15 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
/**
* @var Collection<int, Calendar>
*/
#[ORM\ManyToMany(targetEntity: \Chill\CalendarBundle\Entity\Calendar::class, mappedBy: 'persons')]
#[ORM\ManyToMany(targetEntity: Calendar::class, mappedBy: 'persons')]
private Collection $calendars;
/**
* The person's center.
*
*
* @deprecated
*/
#[ORM\ManyToOne(targetEntity: \Chill\MainBundle\Entity\Center::class)]
#[ORM\ManyToOne(targetEntity: Center::class)]
private ?Center $center = null;
#[ORM\OneToOne(targetEntity: PersonCenterCurrent::class, mappedBy: 'person')]
@ -184,10 +171,8 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
/**
* The marital status of the person.
*
*
*/
#[ORM\ManyToOne(targetEntity: \Chill\MainBundle\Entity\Civility::class)]
#[ORM\ManyToOne(targetEntity: Civility::class)]
#[ORM\JoinColumn(nullable: true)]
private ?Civility $civility = null;
@ -199,17 +184,14 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
/**
* The person's country of birth.
*
*
*/
#[ORM\ManyToOne(targetEntity: \Chill\MainBundle\Entity\Country::class)] // sf4 check: option inversedBy="birthsIn" return error mapping !!
#[ORM\ManyToOne(targetEntity: Country::class)] // sf4 check: option inversedBy="birthsIn" return error mapping !!
#[ORM\JoinColumn(nullable: true)]
private ?Country $countryOfBirth = null;
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATETIME_MUTABLE, nullable: true, options: ['default' => null])]
private ?\DateTimeInterface $createdAt = null;
#[ORM\ManyToOne(targetEntity: User::class)]
#[ORM\JoinColumn(nullable: true)]
private ?User $createdBy = null;
@ -273,7 +255,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
/**
* Comment on gender.
*/
#[ORM\Embedded(class: \Chill\MainBundle\Entity\Embeddable\CommentEmbeddable::class, columnPrefix: 'genderComment_')]
#[ORM\Embedded(class: CommentEmbeddable::class, columnPrefix: 'genderComment_')]
private CommentEmbeddable $genderComment;
/**
@ -292,9 +274,6 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
/**
* The person's id.
*
*
*
*/
#[ORM\Id]
#[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)]
@ -311,17 +290,15 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
/**
* The marital status of the person.
*
*
*/
#[ORM\ManyToOne(targetEntity: \Chill\PersonBundle\Entity\MaritalStatus::class)]
#[ORM\ManyToOne(targetEntity: MaritalStatus::class)]
#[ORM\JoinColumn(nullable: true)]
private ?MaritalStatus $maritalStatus = null;
/**
* Comment on marital status.
*/
#[ORM\Embedded(class: \Chill\MainBundle\Entity\Embeddable\CommentEmbeddable::class, columnPrefix: 'maritalStatusComment_')]
#[ORM\Embedded(class: CommentEmbeddable::class, columnPrefix: 'maritalStatusComment_')]
private CommentEmbeddable $maritalStatusComment;
/**
@ -347,10 +324,8 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
/**
* The person's nationality.
*
*
*/
#[ORM\ManyToOne(targetEntity: \Chill\MainBundle\Entity\Country::class)] // sf4 check: option inversedBy="nationals" return error mapping !!
#[ORM\ManyToOne(targetEntity: Country::class)] // sf4 check: option inversedBy="nationals" return error mapping !!
#[ORM\JoinColumn(nullable: true)]
private ?Country $nationality = null;
@ -364,7 +339,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
* @var Collection<PersonPhone>
*/
#[Assert\Valid(traverse: true)]
#[ORM\OneToMany(targetEntity: \Chill\PersonBundle\Entity\PersonPhone::class, mappedBy: 'person', cascade: ['persist', 'remove', 'merge', 'detach'], orphanRemoval: true)]
#[ORM\OneToMany(targetEntity: PersonPhone::class, mappedBy: 'person', cascade: ['persist', 'remove', 'merge', 'detach'], orphanRemoval: true)]
private Collection $otherPhoneNumbers;
/**
@ -376,7 +351,6 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
/**
* The person's phonenumber.
*
*
* @PhonenumberConstraint(
* type="landline",
* )
@ -405,10 +379,8 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
* The person's spoken languages.
*
* @var Collection<int, Language>
*
*
*/
#[ORM\ManyToMany(targetEntity: \Chill\MainBundle\Entity\Language::class)]
#[ORM\ManyToMany(targetEntity: Language::class)]
#[ORM\JoinTable(name: 'persons_spoken_languages', joinColumns: [new ORM\JoinColumn(name: 'person_id', referencedColumnName: 'id')], inverseJoinColumns: [new ORM\JoinColumn(name: 'language_id', referencedColumnName: 'id')])]
private Collection $spokenLanguages;

View File

@ -21,8 +21,6 @@ use Doctrine\ORM\Mapping as ORM;
* The process of selecting the current center is done on database side,
* using a SQL view.
*
*
*
* @psalm-internal Chill\PersonBundle\Entity
*/
#[ORM\Entity(readOnly: true)]
@ -35,7 +33,6 @@ class PersonCenterCurrent
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATE_IMMUTABLE, nullable: true, options: ['default' => null])]
private ?\DateTimeImmutable $endDate = null;
#[ORM\Id]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER)]
private ?int $id = null;

View File

@ -21,8 +21,6 @@ use Doctrine\ORM\Mapping as ORM;
/**
* Associate a Person with a Center. The association may change on date intervals.
*
*
*/
#[ORM\Entity]
#[ORM\Table(name: 'chill_person_person_center_history')]
@ -35,7 +33,6 @@ class PersonCenterHistory implements TrackCreationInterface, TrackUpdateInterfac
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATE_IMMUTABLE, nullable: true, options: ['default' => null])]
private ?\DateTimeImmutable $endDate = null;
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER)]

View File

@ -23,8 +23,6 @@ use Doctrine\ORM\Mapping as ORM;
*
* The validFrom and validTo properties are the intersection of
* household membership and address validity. See @see{PersonHouseholdAddress}
*
*
*/
#[ORM\Entity(readOnly: true)]
#[ORM\Table('view_chill_person_current_address')]
@ -33,7 +31,6 @@ class PersonCurrentAddress
#[ORM\OneToOne(targetEntity: Address::class)]
protected Address $address;
#[ORM\Id]
#[ORM\OneToOne(targetEntity: Person::class, inversedBy: 'currentPersonAddress')]
#[ORM\JoinColumn(name: 'person_id', referencedColumnName: 'id')]

View File

@ -24,7 +24,6 @@ use Symfony\Component\Serializer\Annotation\Groups;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Component\Validator\Context\ExecutionContextInterface;
#[Serializer\DiscriminatorMap(typeProperty: 'type', mapping: ['personResource' => PersonResource::class])]
#[ORM\Entity]
#[ORM\Table(name: 'chill_person_resource')]
@ -35,21 +34,19 @@ class PersonResource implements TrackCreationInterface, TrackUpdateInterface
use TrackUpdateTrait;
#[Groups(['read', 'docgen:read'])]
#[ORM\Embedded(class: \Chill\MainBundle\Entity\Embeddable\CommentEmbeddable::class, columnPrefix: 'comment_')]
#[ORM\Embedded(class: CommentEmbeddable::class, columnPrefix: 'comment_')]
private CommentEmbeddable $comment;
#[Groups(['read', 'docgen:read'])]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT, nullable: true)]
private ?string $freeText = null;
#[Groups(['read', 'docgen:read'])]
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER)]
private ?int $id = null;
#[Groups(['read', 'docgen:read'])]
#[ORM\ManyToOne(targetEntity: PersonResourceKind::class, inversedBy: 'personResources')]
#[ORM\JoinColumn(nullable: true)]
@ -57,8 +54,6 @@ class PersonResource implements TrackCreationInterface, TrackUpdateInterface
/**
* The person which host the owner of this resource.
*
*
*/
#[Groups(['read', 'docgen:read'])]
#[ORM\ManyToOne(targetEntity: Person::class)]
@ -67,15 +62,12 @@ class PersonResource implements TrackCreationInterface, TrackUpdateInterface
/**
* The person linked with this resource.
*
*
*/
#[Groups(['read'])]
#[ORM\ManyToOne(targetEntity: Person::class, inversedBy: 'resources')]
#[ORM\JoinColumn(nullable: false)]
private ?Person $personOwner = null;
#[Groups(['read', 'docgen:read'])]
#[ORM\ManyToOne(targetEntity: ThirdParty::class, inversedBy: 'personResources')]
#[ORM\JoinColumn(nullable: true)]

View File

@ -14,12 +14,10 @@ namespace Chill\PersonBundle\Entity\Person;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation as Serializer;
#[ORM\Entity]
#[ORM\Table(name: 'chill_person_resource_kind')]
class PersonResourceKind
{
#[Serializer\Groups(['docgen:read'])]
#[ORM\Id]
#[ORM\GeneratedValue]

View File

@ -20,44 +20,38 @@ use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation\Context;
use Symfony\Component\Serializer\Annotation\Groups;
#[ORM\Entity(repositoryClass: ResidentialAddressRepository::class)]
#[ORM\Table(name: 'chill_person_residential_address')]
class ResidentialAddress
{
#[Groups(['read'])]
#[ORM\ManyToOne(targetEntity: Address::class)]
#[ORM\JoinColumn(nullable: true)]
private ?Address $address = null;
#[ORM\Embedded(class: \Chill\MainBundle\Entity\Embeddable\CommentEmbeddable::class, columnPrefix: 'residentialAddressComment_')]
#[ORM\Embedded(class: CommentEmbeddable::class, columnPrefix: 'residentialAddressComment_')]
private CommentEmbeddable $comment;
#[Groups(['read'])]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATETIME_IMMUTABLE, nullable: true)]
private ?\DateTimeImmutable $endDate = null;
#[Groups(['read'])]
#[ORM\ManyToOne(targetEntity: Person::class)]
#[ORM\JoinColumn(nullable: true)]
#[Context(normalizationContext: ['groups' => ['minimal']])]
private ?Person $hostPerson = null;
#[Groups(['read'])]
#[ORM\ManyToOne(targetEntity: ThirdParty::class)]
#[ORM\JoinColumn(nullable: true)]
private ?ThirdParty $hostThirdParty = null;
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER)]
private ?int $id = null;
#[ORM\ManyToOne(targetEntity: Person::class)]
#[ORM\JoinColumn(nullable: false)]
private Person $person;

View File

@ -16,14 +16,11 @@ use Symfony\Component\Serializer\Annotation\Groups;
/**
* PersonAltName.
*
*
*/
#[ORM\Entity]
#[ORM\Table(name: 'chill_person_alt_name')]
class PersonAltName
{
#[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)]
#[ORM\Id]
#[ORM\GeneratedValue(strategy: 'AUTO')]
@ -37,7 +34,7 @@ class PersonAltName
#[ORM\Column(name: 'label', type: \Doctrine\DBAL\Types\Types::TEXT)]
private string $label = '';
#[ORM\ManyToOne(targetEntity: \Chill\PersonBundle\Entity\Person::class, inversedBy: 'altNames')]
#[ORM\ManyToOne(targetEntity: Person::class, inversedBy: 'altNames')]
private ?Person $person = null;
/**

Some files were not shown because too many files have changed in this diff Show More