|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138 |
- <?php
-
- namespace Lc\CaracoleBundle\Doctrine\Extension;
-
- use Doctrine\Common\Collections\ArrayCollection;
- use Doctrine\Common\Collections\Collection;
- use Doctrine\ORM\Mapping as ORM;
- use Lc\CaracoleBundle\Model\Merchant\MerchantInterface;
- use Lc\SovBundle\Model\User\GroupUserInterface;
- use Lc\SovBundle\Model\User\UserInterface;
-
- trait ReductionPropertyTrait
- {
-
- /**
- * @ORM\ManyToMany(targetEntity="Lc\SovBundle\Model\User\UserInterface")
- */
- protected $users;
-
- /**
- * @ORM\ManyToMany(targetEntity="Lc\SovBundle\Model\User\GroupUserInterface")
- */
- protected $groupUsers;
-
-
- /**
- * @ORM\Column(type="datetime", nullable=true)
- */
- protected $dateStart;
-
- /**
- * @ORM\Column(type="datetime", nullable=true)
- */
- protected $dateEnd;
-
- /**
- * @ORM\Column(type="boolean")
- */
- protected $permanent;
-
-
- public function __construct()
- {
- $this->users = new ArrayCollection();
- $this->groupUsers = new ArrayCollection();
- }
-
- /**
- * @return Collection|UserInterface[]
- */
- public function getUsers(): Collection
- {
- return $this->users;
- }
-
- public function addUser(UserInterface $user): self
- {
- if (!$this->users->contains($user)) {
- $this->users[] = $user;
- }
-
- return $this;
- }
-
- public function removeUser(UserInterface $user): self
- {
- if ($this->users->contains($user)) {
- $this->users->removeElement($user);
- }
-
- return $this;
- }
-
-
- /**
- * @return Collection|GroupUserInterface[]
- */
- public function getGroupUsers(): Collection
- {
- return $this->groupUsers;
- }
-
- public function addGroupUser(GroupUserInterface $groupUser): self
- {
- if (!$this->groupUsers->contains($groupUser)) {
- $this->groupUsers[] = $groupUser;
- }
-
- return $this;
- }
-
- public function removeGroupUser(GroupUserInterface $groupUser): self
- {
- if ($this->groupUsers->contains($groupUser)) {
- $this->groupUsers->removeElement($groupUser);
- }
-
- return $this;
- }
-
-
- public function getDateStart(): ?\DateTimeInterface
- {
- return $this->dateStart;
- }
-
- public function setDateStart(?\DateTimeInterface $dateStart): self
- {
- $this->dateStart = $dateStart;
-
- return $this;
- }
-
- public function getDateEnd(): ?\DateTimeInterface
- {
- return $this->dateEnd;
- }
-
- public function setDateEnd(?\DateTimeInterface $dateEnd): self
- {
- $this->dateEnd = $dateEnd;
-
- return $this;
- }
-
- public function getPermanent(): ?bool
- {
- return $this->permanent;
- }
-
- public function setPermanent(bool $permanent): self
- {
- $this->permanent = $permanent;
-
- return $this;
- }
-
- }
|