Apply rector rules: add annotation for doctrine mapping

This commit is contained in:
2024-04-05 13:11:42 +02:00
parent a3f775a69b
commit 0ff4593863
118 changed files with 143 additions and 658 deletions

View File

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