mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 15:13:50 +00:00
Add missing fields & migrations
This commit is contained in:
@@ -48,6 +48,9 @@ use Chill\MainBundle\Validator\Constraints\Entity\UserCircleConsistency;
|
||||
*/
|
||||
class Activity implements HasCenterInterface, HasScopeInterface
|
||||
{
|
||||
const SENTRECEIVED_SENT = 'sent';
|
||||
const SENTRECEIVED_RECEIVED = 'received';
|
||||
|
||||
/**
|
||||
* @ORM\Id
|
||||
* @ORM\Column(name="id", type="integer")
|
||||
@@ -71,9 +74,14 @@ class Activity implements HasCenterInterface, HasScopeInterface
|
||||
private \DateTime $durationTime;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="boolean")
|
||||
* @ORM\Column(type="time")
|
||||
*/
|
||||
private bool $attendee;
|
||||
private \DateTime $travelTime;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity="Chill\ActivityBundle\Entity\ActivityPresence")
|
||||
*/
|
||||
private ActivityPresence $attendee;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToMany(targetEntity="Chill\ActivityBundle\Entity\ActivityReason")
|
||||
@@ -101,25 +109,35 @@ class Activity implements HasCenterInterface, HasScopeInterface
|
||||
private CommentEmbeddable $comment;
|
||||
|
||||
/**
|
||||
* @ORM\OneToMany(targetEntity="Chill\PersonBundle\Entity\Person", mappedBy="person")
|
||||
* @ORM\ManyToMany(targetEntity="Chill\PersonBundle\Entity\Person")
|
||||
*/
|
||||
private ArrayCollection $persons;
|
||||
|
||||
/**
|
||||
* @ORM\OneToMany(targetEntity="Chill\ThirdPartyBundle\Entity\ThirdParty", mappedBy="thirdParty")
|
||||
* @ORM\ManyToMany(targetEntity="Chill\ThirdPartyBundle\Entity\ThirdParty")
|
||||
*/
|
||||
private ArrayCollection $thirdParties;
|
||||
|
||||
/**
|
||||
* @ORM\OneToMany(targetEntity="Chill\DocStoreBundle\Entity\Document", mappedBy="document")
|
||||
* @ORM\ManyToMany(targetEntity="Chill\DocStoreBundle\Entity\Document")
|
||||
*/
|
||||
private ArrayCollection $documents;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="boolean")
|
||||
* @ORM\ManyToMany(targetEntity="Chill\MainBundle\Entity\User")
|
||||
*/
|
||||
private ArrayCollection $users;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="boolean", options={"default"=false})
|
||||
*/
|
||||
private bool $emergency = false;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", options={"default"=""})
|
||||
*/
|
||||
private string $sentReceived = '';
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->reasons = new ArrayCollection();
|
||||
@@ -127,6 +145,7 @@ class Activity implements HasCenterInterface, HasScopeInterface
|
||||
$this->persons = new ArrayCollection();
|
||||
$this->thirdParties = new ArrayCollection();
|
||||
$this->documents = new ArrayCollection();
|
||||
$this->users = new ArrayCollection();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -191,20 +210,26 @@ class Activity implements HasCenterInterface, HasScopeInterface
|
||||
return $this->durationTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set attendee
|
||||
*/
|
||||
public function setAttendee(bool $attendee): self
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get attendee
|
||||
*/
|
||||
public function getAttendee(): bool
|
||||
public function getAttendee(): ActivityPresence
|
||||
{
|
||||
return $this->attendee;
|
||||
}
|
||||
@@ -382,6 +407,30 @@ class Activity implements HasCenterInterface, HasScopeInterface
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function addUser(User $user): self
|
||||
{
|
||||
$this->users[] = $user;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeUser(User $user): void
|
||||
{
|
||||
$this->users->removeElement($user);
|
||||
}
|
||||
|
||||
public function getUsers(): ArrayCollection
|
||||
{
|
||||
return $this->users;
|
||||
}
|
||||
|
||||
public function setUsers(ArrayCollection $users): self
|
||||
{
|
||||
$this->users = $users;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function isEmergency(): bool
|
||||
{
|
||||
return $this->getEmergency();
|
||||
@@ -398,5 +447,17 @@ class Activity implements HasCenterInterface, HasScopeInterface
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getSentReceived(): string
|
||||
{
|
||||
return $this->sentReceived;
|
||||
}
|
||||
|
||||
public function setSentReceived(string $sentReceived): self
|
||||
{
|
||||
$this->sentReceived = $sentReceived;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -49,17 +49,11 @@ class ActivityPresence
|
||||
*/
|
||||
private bool $active = true;
|
||||
|
||||
/**
|
||||
* Get id
|
||||
*/
|
||||
public function getId(): int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set name
|
||||
*/
|
||||
public function setName(array $name): self
|
||||
{
|
||||
$this->name = $name;
|
||||
|
@@ -128,6 +128,16 @@ class ActivityType
|
||||
*/
|
||||
private string $durationTimeLabel = '';
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="smallint", nullable=false, options={"default"=1})
|
||||
*/
|
||||
private int $travelTimeVisible = self::FIELD_OPTIONAL;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", nullable=false, options={"default"=""})
|
||||
*/
|
||||
private string $travelTimeLabel = '';
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="smallint", nullable=false, options={"default"=1})
|
||||
*/
|
||||
@@ -178,6 +188,16 @@ class ActivityType
|
||||
*/
|
||||
private string $documentsLabel = '';
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="smallint", nullable=false, options={"default"=1})
|
||||
*/
|
||||
private int $usersVisible = self::FIELD_OPTIONAL;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", nullable=false, options={"default"=""})
|
||||
*/
|
||||
private string $usersLabel = '';
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="smallint", nullable=false, options={"default"=1})
|
||||
*/
|
||||
@@ -413,6 +433,26 @@ class ActivityType
|
||||
$this->durationTimeLabel = $durationTimeLabel;
|
||||
}
|
||||
|
||||
public function getTravelTimeVisible(): int
|
||||
{
|
||||
return $this->travelTimeVisible;
|
||||
}
|
||||
|
||||
public function setTravelTimeVisible(int $TravelTimeVisible): void
|
||||
{
|
||||
$this->travelTimeVisible = $TravelTimeVisible;
|
||||
}
|
||||
|
||||
public function getTravelTimeLabel(): string
|
||||
{
|
||||
return $this->travelTimeLabel;
|
||||
}
|
||||
|
||||
public function setTravelTimeLabel(string $TravelTimeLabel): void
|
||||
{
|
||||
$this->travelTimeLabel = $TravelTimeLabel;
|
||||
}
|
||||
|
||||
public function getAttendeeVisible(): int
|
||||
{
|
||||
return $this->attendeeVisible;
|
||||
@@ -513,6 +553,26 @@ class ActivityType
|
||||
$this->documentsLabel = $documentsLabel;
|
||||
}
|
||||
|
||||
public function getUsersVisible(): int
|
||||
{
|
||||
return $this->usersVisible;
|
||||
}
|
||||
|
||||
public function setUsersVisible(int $usersVisible): void
|
||||
{
|
||||
$this->usersVisible = $usersVisible;
|
||||
}
|
||||
|
||||
public function getUsersLabel(): string
|
||||
{
|
||||
return $this->usersLabel;
|
||||
}
|
||||
|
||||
public function setUsersLabel(string $usersLabel): void
|
||||
{
|
||||
$this->usersLabel = $usersLabel;
|
||||
}
|
||||
|
||||
public function getEmergencyVisible(): int
|
||||
{
|
||||
return $this->emergencyVisible;
|
||||
|
Reference in New Issue
Block a user