mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 07:03:49 +00:00
cs: Fix code style (safe rules only).
This commit is contained in:
@@ -1,39 +1,46 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Chill is a software for social workers
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Chill\ActivityBundle\Entity;
|
||||
|
||||
use Chill\DocStoreBundle\Entity\Document;
|
||||
use Chill\MainBundle\Entity\Center;
|
||||
use Chill\MainBundle\Entity\Embeddable\CommentEmbeddable;
|
||||
use Chill\MainBundle\Entity\HasCenterInterface;
|
||||
use Chill\MainBundle\Entity\HasScopeInterface;
|
||||
use Chill\MainBundle\Entity\Location;
|
||||
use Chill\MainBundle\Entity\Scope;
|
||||
use Chill\MainBundle\Entity\User;
|
||||
use Chill\PersonBundle\AccompanyingPeriod\SocialIssueConsistency\AccompanyingPeriodLinkedWithSocialIssuesEntityInterface;
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
||||
use Chill\PersonBundle\Entity\Person;
|
||||
use Chill\PersonBundle\Entity\SocialWork\SocialAction;
|
||||
use Chill\PersonBundle\Entity\SocialWork\SocialIssue;
|
||||
use Chill\ThirdPartyBundle\Entity\ThirdParty;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Chill\MainBundle\Entity\Scope;
|
||||
use Chill\MainBundle\Entity\User;
|
||||
use Chill\MainBundle\Entity\Center;
|
||||
use Chill\PersonBundle\Entity\Person;
|
||||
use Chill\MainBundle\Entity\HasCenterInterface;
|
||||
use Chill\MainBundle\Entity\HasScopeInterface;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use DateTime;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\Security\Core\User\UserInterface;
|
||||
use Symfony\Component\Serializer\Annotation\Groups;
|
||||
use Symfony\Component\Serializer\Annotation\DiscriminatorMap;
|
||||
use Symfony\Component\Serializer\Annotation\Groups;
|
||||
use Symfony\Component\Serializer\Annotation\SerializedName;
|
||||
|
||||
/**
|
||||
* Class Activity
|
||||
* Class Activity.
|
||||
*
|
||||
* @package Chill\ActivityBundle\Entity
|
||||
* @ORM\Entity(repositoryClass="Chill\ActivityBundle\Repository\ActivityRepository")
|
||||
* @ORM\Table(name="activity")
|
||||
* @ORM\HasLifecycleCallbacks()
|
||||
* @ORM\HasLifecycleCallbacks
|
||||
* @DiscriminatorMap(typeProperty="type", mapping={
|
||||
* "activity"=Activity::class
|
||||
* })
|
||||
* "activity": Activity::class
|
||||
* })
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -46,60 +53,15 @@ use Symfony\Component\Serializer\Annotation\SerializedName;
|
||||
|
||||
class Activity implements HasCenterInterface, HasScopeInterface, AccompanyingPeriodLinkedWithSocialIssuesEntityInterface
|
||||
{
|
||||
const SENTRECEIVED_SENT = 'sent';
|
||||
const SENTRECEIVED_RECEIVED = 'received';
|
||||
public const SENTRECEIVED_RECEIVED = 'received';
|
||||
|
||||
public const SENTRECEIVED_SENT = 'sent';
|
||||
|
||||
/**
|
||||
* @ORM\Id
|
||||
* @ORM\Column(name="id", type="integer")
|
||||
* @ORM\GeneratedValue(strategy="AUTO")
|
||||
* @ORM\ManyToOne(targetEntity="Chill\PersonBundle\Entity\AccompanyingPeriod")
|
||||
* @Groups({"read"})
|
||||
*/
|
||||
private ?int $id = null;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity="Chill\MainBundle\Entity\User")
|
||||
*/
|
||||
private User $user;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="datetime")
|
||||
*/
|
||||
private \DateTime $date;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="time", nullable=true)
|
||||
*/
|
||||
private ?\DateTime $durationTime = null;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="time", nullable=true)
|
||||
*/
|
||||
private ?\DateTime $travelTime = null;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity="Chill\ActivityBundle\Entity\ActivityPresence")
|
||||
*/
|
||||
private ?ActivityPresence $attendee = null;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToMany(targetEntity="Chill\ActivityBundle\Entity\ActivityReason")
|
||||
*/
|
||||
private Collection $reasons;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToMany(targetEntity="Chill\PersonBundle\Entity\SocialWork\SocialIssue")
|
||||
* @ORM\JoinTable(name="chill_activity_activity_chill_person_socialissue")
|
||||
* @Groups({"read"})
|
||||
*/
|
||||
private Collection $socialIssues;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToMany(targetEntity="Chill\PersonBundle\Entity\SocialWork\SocialAction")
|
||||
* @ORM\JoinTable(name="chill_activity_activity_chill_person_socialaction")
|
||||
* @Groups({"read"})
|
||||
*/
|
||||
private Collection $socialActions;
|
||||
private ?AccompanyingPeriod $accompanyingPeriod = null;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity="Chill\ActivityBundle\Entity\ActivityType")
|
||||
@@ -110,32 +72,89 @@ class Activity implements HasCenterInterface, HasScopeInterface, AccompanyingPer
|
||||
private ActivityType $activityType;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity="Chill\MainBundle\Entity\Scope")
|
||||
* @ORM\ManyToOne(targetEntity="Chill\ActivityBundle\Entity\ActivityPresence")
|
||||
*/
|
||||
private ?Scope $scope = null;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity="Chill\PersonBundle\Entity\Person")
|
||||
*/
|
||||
private ?Person $person = null;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity="Chill\PersonBundle\Entity\AccompanyingPeriod")
|
||||
* @Groups({"read"})
|
||||
*/
|
||||
private ?AccompanyingPeriod $accompanyingPeriod = null;
|
||||
private ?ActivityPresence $attendee = null;
|
||||
|
||||
/**
|
||||
* @ORM\Embedded(class="Chill\MainBundle\Entity\Embeddable\CommentEmbeddable", columnPrefix="comment_")
|
||||
*/
|
||||
private CommentEmbeddable $comment;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="datetime")
|
||||
*/
|
||||
private DateTime $date;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToMany(targetEntity="Chill\DocStoreBundle\Entity\StoredObject", cascade={"persist"})
|
||||
*/
|
||||
private Collection $documents;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="time", nullable=true)
|
||||
*/
|
||||
private ?DateTime $durationTime = null;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="boolean", options={"default": false})
|
||||
*/
|
||||
private bool $emergency = false;
|
||||
|
||||
/**
|
||||
* @ORM\Id
|
||||
* @ORM\Column(name="id", type="integer")
|
||||
* @ORM\GeneratedValue(strategy="AUTO")
|
||||
* @Groups({"read"})
|
||||
*/
|
||||
private ?int $id = null;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity="Chill\MainBundle\Entity\Location")
|
||||
* @groups({"read"})
|
||||
*/
|
||||
private ?Location $location = null;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity="Chill\PersonBundle\Entity\Person")
|
||||
*/
|
||||
private ?Person $person = null;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToMany(targetEntity="Chill\PersonBundle\Entity\Person")
|
||||
* @Groups({"read"})
|
||||
*/
|
||||
private ?Collection $persons = null;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToMany(targetEntity="Chill\ActivityBundle\Entity\ActivityReason")
|
||||
*/
|
||||
private Collection $reasons;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity="Chill\MainBundle\Entity\Scope")
|
||||
*/
|
||||
private ?Scope $scope = null;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", options={"default": ""})
|
||||
*/
|
||||
private string $sentReceived = '';
|
||||
|
||||
/**
|
||||
* @ORM\ManyToMany(targetEntity="Chill\PersonBundle\Entity\SocialWork\SocialAction")
|
||||
* @ORM\JoinTable(name="chill_activity_activity_chill_person_socialaction")
|
||||
* @Groups({"read"})
|
||||
*/
|
||||
private Collection $socialActions;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToMany(targetEntity="Chill\PersonBundle\Entity\SocialWork\SocialIssue")
|
||||
* @ORM\JoinTable(name="chill_activity_activity_chill_person_socialissue")
|
||||
* @Groups({"read"})
|
||||
*/
|
||||
private Collection $socialIssues;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToMany(targetEntity="Chill\ThirdPartyBundle\Entity\ThirdParty")
|
||||
* @Groups({"read"})
|
||||
@@ -143,9 +162,14 @@ class Activity implements HasCenterInterface, HasScopeInterface, AccompanyingPer
|
||||
private ?Collection $thirdParties = null;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToMany(targetEntity="Chill\DocStoreBundle\Entity\StoredObject", cascade={"persist"})
|
||||
* @ORM\Column(type="time", nullable=true)
|
||||
*/
|
||||
private Collection $documents;
|
||||
private ?DateTime $travelTime = null;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity="Chill\MainBundle\Entity\User")
|
||||
*/
|
||||
private User $user;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToMany(targetEntity="Chill\MainBundle\Entity\User")
|
||||
@@ -153,23 +177,6 @@ class Activity implements HasCenterInterface, HasScopeInterface, AccompanyingPer
|
||||
*/
|
||||
private ?Collection $users = null;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="boolean", options={"default"=false})
|
||||
*/
|
||||
private bool $emergency = false;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", options={"default"=""})
|
||||
*/
|
||||
private string $sentReceived = '';
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity="Chill\MainBundle\Entity\Location")
|
||||
* @groups({"read"})
|
||||
*/
|
||||
private ?Location $location = null;
|
||||
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->reasons = new ArrayCollection();
|
||||
@@ -182,71 +189,25 @@ class Activity implements HasCenterInterface, HasScopeInterface, AccompanyingPer
|
||||
$this->socialActions = new ArrayCollection();
|
||||
}
|
||||
|
||||
public function getId(): ?int
|
||||
public function addDocument(Document $document): self
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function setUser(UserInterface $user): self
|
||||
{
|
||||
$this->user = $user;
|
||||
$this->documents[] = $document;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getUser(): User
|
||||
/**
|
||||
* Add a person to the person list.
|
||||
*/
|
||||
public function addPerson(?Person $person): self
|
||||
{
|
||||
return $this->user;
|
||||
}
|
||||
|
||||
public function setDate(\DateTime $date): self
|
||||
{
|
||||
$this->date = $date;
|
||||
if (null !== $person) {
|
||||
$this->persons[] = $person;
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getDate(): \DateTime
|
||||
{
|
||||
return $this->date;
|
||||
}
|
||||
|
||||
public function setDurationTime(?\DateTime $durationTime): self
|
||||
{
|
||||
$this->durationTime = $durationTime;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getDurationTime(): ?\DateTime
|
||||
{
|
||||
return $this->durationTime;
|
||||
}
|
||||
|
||||
public function setTravelTime(\DateTime $travelTime): self
|
||||
{
|
||||
$this->travelTime = $travelTime;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getTravelTime(): ?\DateTime
|
||||
{
|
||||
return $this->travelTime;
|
||||
}
|
||||
|
||||
public function setAttendee(ActivityPresence $attendee): self
|
||||
{
|
||||
$this->attendee = $attendee;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getAttendee(): ?ActivityPresence
|
||||
{
|
||||
return $this->attendee;
|
||||
}
|
||||
|
||||
public function addReason(ActivityReason $reason): self
|
||||
{
|
||||
$this->reasons->add($reason);
|
||||
@@ -254,49 +215,6 @@ class Activity implements HasCenterInterface, HasScopeInterface, AccompanyingPer
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeReason(ActivityReason $reason): void
|
||||
{
|
||||
$this->reasons->removeElement($reason);
|
||||
}
|
||||
|
||||
public function getReasons(): Collection
|
||||
{
|
||||
return $this->reasons;
|
||||
}
|
||||
|
||||
public function setReasons(?ArrayCollection $reasons): self
|
||||
{
|
||||
$this->reasons = $reasons;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getSocialIssues(): Collection
|
||||
{
|
||||
return $this->socialIssues;
|
||||
}
|
||||
|
||||
public function addSocialIssue(SocialIssue $socialIssue): self
|
||||
{
|
||||
if (!$this->socialIssues->contains($socialIssue)) {
|
||||
$this->socialIssues[] = $socialIssue;
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeSocialIssue(SocialIssue $socialIssue): self
|
||||
{
|
||||
$this->socialIssues->removeElement($socialIssue);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getSocialActions(): Collection
|
||||
{
|
||||
return $this->socialActions;
|
||||
}
|
||||
|
||||
public function addSocialAction(SocialAction $socialAction): self
|
||||
{
|
||||
if (!$this->socialActions->contains($socialAction)) {
|
||||
@@ -306,82 +224,51 @@ class Activity implements HasCenterInterface, HasScopeInterface, AccompanyingPer
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeSocialAction(SocialAction $socialAction): self
|
||||
public function addSocialIssue(SocialIssue $socialIssue): self
|
||||
{
|
||||
$this->socialActions->removeElement($socialAction);
|
||||
if (!$this->socialIssues->contains($socialIssue)) {
|
||||
$this->socialIssues[] = $socialIssue;
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setActivityType(ActivityType $activityType): self
|
||||
public function addThirdParty(?ThirdParty $thirdParty): self
|
||||
{
|
||||
$this->activityType = $activityType;
|
||||
if (null !== $thirdParty) {
|
||||
$this->thirdParties[] = $thirdParty;
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getActivityType(): ActivityType
|
||||
public function addUser(?User $user): self
|
||||
{
|
||||
return $this->activityType;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
public function setType(ActivityType $activityType): self
|
||||
{
|
||||
$this->activityType = $activityType;
|
||||
if (null !== $user) {
|
||||
$this->users[] = $user;
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
public function getType(): ActivityType
|
||||
{
|
||||
return $this->activityType;
|
||||
}
|
||||
|
||||
public function setScope(Scope $scope): self
|
||||
{
|
||||
$this->scope = $scope;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getScope(): ?Scope
|
||||
{
|
||||
return $this->scope;
|
||||
}
|
||||
|
||||
public function setPerson(?Person $person): self
|
||||
{
|
||||
$this->person = $person;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getPerson(): ?Person
|
||||
{
|
||||
return $this->person;
|
||||
}
|
||||
|
||||
public function getAccompanyingPeriod(): ?AccompanyingPeriod
|
||||
{
|
||||
return $this->accompanyingPeriod;
|
||||
}
|
||||
|
||||
public function setAccompanyingPeriod(?AccompanyingPeriod $accompanyingPeriod): self
|
||||
public function getActivityType(): ActivityType
|
||||
{
|
||||
$this->accompanyingPeriod = $accompanyingPeriod;
|
||||
return $this->activityType;
|
||||
}
|
||||
|
||||
return $this;
|
||||
public function getAttendee(): ?ActivityPresence
|
||||
{
|
||||
return $this->attendee;
|
||||
}
|
||||
|
||||
/**
|
||||
* get the center
|
||||
* center is extracted from person
|
||||
* center is extracted from person.
|
||||
*/
|
||||
public function getCenter(): ?Center
|
||||
{
|
||||
@@ -397,28 +284,39 @@ class Activity implements HasCenterInterface, HasScopeInterface, AccompanyingPer
|
||||
return $this->comment;
|
||||
}
|
||||
|
||||
public function setComment(CommentEmbeddable $comment): self
|
||||
public function getDate(): DateTime
|
||||
{
|
||||
$this->comment = $comment;
|
||||
|
||||
return $this;
|
||||
return $this->date;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a person to the person list
|
||||
*/
|
||||
public function addPerson(?Person $person): self
|
||||
public function getDocuments(): Collection
|
||||
{
|
||||
if (null !== $person) {
|
||||
$this->persons[] = $person;
|
||||
}
|
||||
|
||||
return $this;
|
||||
return $this->documents;
|
||||
}
|
||||
|
||||
public function removePerson(Person $person): void
|
||||
public function getDurationTime(): ?DateTime
|
||||
{
|
||||
$this->persons->removeElement($person);
|
||||
return $this->durationTime;
|
||||
}
|
||||
|
||||
public function getEmergency(): bool
|
||||
{
|
||||
return $this->emergency;
|
||||
}
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getLocation(): ?Location
|
||||
{
|
||||
return $this->location;
|
||||
}
|
||||
|
||||
public function getPerson(): ?Person
|
||||
{
|
||||
return $this->person;
|
||||
}
|
||||
|
||||
public function getPersons(): Collection
|
||||
@@ -430,13 +328,16 @@ class Activity implements HasCenterInterface, HasScopeInterface, AccompanyingPer
|
||||
{
|
||||
if (null !== $this->accompanyingPeriod) {
|
||||
$personsAssociated = [];
|
||||
|
||||
foreach ($this->accompanyingPeriod->getParticipations() as $participation) {
|
||||
if ($this->persons->contains($participation->getPerson())) {
|
||||
$personsAssociated[] = $participation->getPerson();
|
||||
}
|
||||
}
|
||||
|
||||
return $personsAssociated;
|
||||
}
|
||||
|
||||
return [];
|
||||
}
|
||||
|
||||
@@ -444,28 +345,103 @@ class Activity implements HasCenterInterface, HasScopeInterface, AccompanyingPer
|
||||
{
|
||||
if (null !== $this->accompanyingPeriod) {
|
||||
$personsNotAssociated = [];
|
||||
|
||||
foreach ($this->persons as $person) {
|
||||
if (!in_array($person, $this->getPersonsAssociated())) {
|
||||
$personsNotAssociated[] = $person;
|
||||
$personsNotAssociated[] = $person;
|
||||
}
|
||||
}
|
||||
|
||||
return $personsNotAssociated;
|
||||
}
|
||||
|
||||
return [];
|
||||
}
|
||||
|
||||
public function setPersons(?Collection $persons): self
|
||||
public function getReasons(): Collection
|
||||
{
|
||||
$this->persons = $persons;
|
||||
return $this->reasons;
|
||||
}
|
||||
|
||||
public function getScope(): ?Scope
|
||||
{
|
||||
return $this->scope;
|
||||
}
|
||||
|
||||
public function getSentReceived(): string
|
||||
{
|
||||
return $this->sentReceived;
|
||||
}
|
||||
|
||||
public function getSocialActions(): Collection
|
||||
{
|
||||
return $this->socialActions;
|
||||
}
|
||||
|
||||
public function getSocialIssues(): Collection
|
||||
{
|
||||
return $this->socialIssues;
|
||||
}
|
||||
|
||||
public function getThirdParties(): Collection
|
||||
{
|
||||
return $this->thirdParties;
|
||||
}
|
||||
|
||||
public function getTravelTime(): ?DateTime
|
||||
{
|
||||
return $this->travelTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
public function getType(): ActivityType
|
||||
{
|
||||
return $this->activityType;
|
||||
}
|
||||
|
||||
public function getUser(): User
|
||||
{
|
||||
return $this->user;
|
||||
}
|
||||
|
||||
public function getUsers(): Collection
|
||||
{
|
||||
return $this->users;
|
||||
}
|
||||
|
||||
public function isEmergency(): bool
|
||||
{
|
||||
return $this->getEmergency();
|
||||
}
|
||||
|
||||
public function removeDocument(Document $document): void
|
||||
{
|
||||
$this->documents->removeElement($document);
|
||||
}
|
||||
|
||||
public function removePerson(Person $person): void
|
||||
{
|
||||
$this->persons->removeElement($person);
|
||||
}
|
||||
|
||||
public function removeReason(ActivityReason $reason): void
|
||||
{
|
||||
$this->reasons->removeElement($reason);
|
||||
}
|
||||
|
||||
public function removeSocialAction(SocialAction $socialAction): self
|
||||
{
|
||||
$this->socialActions->removeElement($socialAction);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function addThirdParty(?ThirdParty $thirdParty): self
|
||||
public function removeSocialIssue(SocialIssue $socialIssue): self
|
||||
{
|
||||
if (null !== $thirdParty) {
|
||||
$this->thirdParties[] = $thirdParty;
|
||||
}
|
||||
$this->socialIssues->removeElement($socialIssue);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
@@ -474,33 +450,44 @@ class Activity implements HasCenterInterface, HasScopeInterface, AccompanyingPer
|
||||
$this->thirdParties->removeElement($thirdParty);
|
||||
}
|
||||
|
||||
public function getThirdParties(): Collection
|
||||
public function removeUser(User $user): void
|
||||
{
|
||||
return $this->thirdParties;
|
||||
$this->users->removeElement($user);
|
||||
}
|
||||
|
||||
public function setThirdParties(?Collection $thirdParties): self
|
||||
public function setAccompanyingPeriod(?AccompanyingPeriod $accompanyingPeriod): self
|
||||
{
|
||||
$this->thirdParties = $thirdParties;
|
||||
$this->accompanyingPeriod = $accompanyingPeriod;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function addDocument(Document $document): self
|
||||
public function setActivityType(ActivityType $activityType): self
|
||||
{
|
||||
$this->documents[] = $document;
|
||||
$this->activityType = $activityType;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeDocument(Document $document): void
|
||||
public function setAttendee(ActivityPresence $attendee): self
|
||||
{
|
||||
$this->documents->removeElement($document);
|
||||
$this->attendee = $attendee;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getDocuments(): Collection
|
||||
public function setComment(CommentEmbeddable $comment): self
|
||||
{
|
||||
return $this->documents;
|
||||
$this->comment = $comment;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setDate(DateTime $date): self
|
||||
{
|
||||
$this->date = $date;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setDocuments(Collection $documents): self
|
||||
@@ -510,41 +497,13 @@ class Activity implements HasCenterInterface, HasScopeInterface, AccompanyingPer
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function addUser(?User $user): self
|
||||
public function setDurationTime(?DateTime $durationTime): self
|
||||
{
|
||||
if (null !== $user) {
|
||||
$this->users[] = $user;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeUser(User $user): void
|
||||
{
|
||||
$this->users->removeElement($user);
|
||||
}
|
||||
|
||||
public function getUsers(): Collection
|
||||
{
|
||||
return $this->users;
|
||||
}
|
||||
|
||||
public function setUsers(?Collection $users): self
|
||||
{
|
||||
$this->users = $users;
|
||||
$this->durationTime = $durationTime;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function isEmergency(): bool
|
||||
{
|
||||
return $this->getEmergency();
|
||||
}
|
||||
|
||||
public function getEmergency(): bool
|
||||
{
|
||||
return $this->emergency;
|
||||
}
|
||||
|
||||
public function setEmergency(bool $emergency): self
|
||||
{
|
||||
$this->emergency = $emergency;
|
||||
@@ -552,9 +511,39 @@ class Activity implements HasCenterInterface, HasScopeInterface, AccompanyingPer
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getSentReceived(): string
|
||||
public function setLocation(?Location $location): Activity
|
||||
{
|
||||
return $this->sentReceived;
|
||||
$this->location = $location;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setPerson(?Person $person): self
|
||||
{
|
||||
$this->person = $person;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setPersons(?Collection $persons): self
|
||||
{
|
||||
$this->persons = $persons;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setReasons(?ArrayCollection $reasons): self
|
||||
{
|
||||
$this->reasons = $reasons;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setScope(Scope $scope): self
|
||||
{
|
||||
$this->scope = $scope;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setSentReceived(?string $sentReceived): self
|
||||
@@ -564,21 +553,41 @@ class Activity implements HasCenterInterface, HasScopeInterface, AccompanyingPer
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Location|null
|
||||
*/
|
||||
public function getLocation(): ?Location
|
||||
public function setThirdParties(?Collection $thirdParties): self
|
||||
{
|
||||
return $this->location;
|
||||
$this->thirdParties = $thirdParties;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setTravelTime(DateTime $travelTime): self
|
||||
{
|
||||
$this->travelTime = $travelTime;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Location|null $location
|
||||
* @return Activity
|
||||
* @deprecated
|
||||
*/
|
||||
public function setLocation(?Location $location): Activity
|
||||
public function setType(ActivityType $activityType): self
|
||||
{
|
||||
$this->location = $location;
|
||||
$this->activityType = $activityType;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setUser(UserInterface $user): self
|
||||
{
|
||||
$this->user = $user;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setUsers(?Collection $users): self
|
||||
{
|
||||
$this->users = $users;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user