|
- <?php
-
- namespace Lc\ShopBundle\Model;
-
- use Doctrine\Common\Collections\ArrayCollection;
- use Doctrine\Common\Collections\Collection;
- use Doctrine\ORM\Mapping as ORM;
- use Lc\ShopBundle\Context\FilterMerchantInterface;
- use Lc\ShopBundle\Context\ReductionInterface;
- use Lc\ShopBundle\Context\ReductionPropertyInterface;
- use Lc\ShopBundle\Context\StatusInterface;
-
-
- abstract class ReductionCredit extends AbstractEntity implements ReductionInterface, FilterMerchantInterface, StatusInterface
- {
- use ReductionTrait;
- use StatusTrait;
-
-
-
-
- protected $title;
-
-
-
- protected $users;
-
-
-
- protected $merchant;
-
-
- public function __construct()
- {
- $this->users = new ArrayCollection();
- }
-
- public function __toString()
- {
- return $this->title;
- }
-
- public function getTitle(): ?string
- {
- return $this->title;
- }
-
- public function setTitle(string $title): self
- {
- $this->title = $title;
-
- return $this;
- }
-
-
- public function getMerchant(): ?Merchant
- {
- return $this->merchant;
- }
-
- public function setMerchant(?Merchant $merchant): self
- {
- $this->merchant = $merchant;
-
- return $this;
- }
-
-
-
- public function getUsers(): Collection
- {
- return $this->users;
- }
-
- public function addUser(User $user): self
- {
- if (!$this->users->contains($user)) {
- $this->users[] = $user;
- }
-
- return $this;
- }
-
- public function removeUser(User $user): self
- {
- if ($this->users->contains($user)) {
- $this->users->removeElement($user);
- }
-
- return $this;
- }
- }
|