src/Entity/Customer/Customer.php line 18

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Entity\Customer;
  4. use App\Entity\UniverseCard\UniverseCard;
  5. use App\Entity\UniverseCard\UniverseCardInterface;
  6. use Doctrine\Common\Collections\ArrayCollection;
  7. use Doctrine\Common\Collections\Collection;
  8. use Doctrine\ORM\Mapping as ORM;
  9. use Sylius\Component\Core\Model\Customer as BaseCustomer;
  10. /**
  11.  * @ORM\Entity
  12.  * @ORM\Table(name="sylius_customer")
  13.  */
  14. class Customer extends BaseCustomer
  15. {
  16.     /** @ORM\Column(name="max_user_id", type="integer", nullable=true) */
  17.     private int|null $maxUserId;
  18.     /**
  19.      * @ORM\OneToMany(targetEntity=UniverseCard::class, mappedBy="customer")
  20.      *
  21.      * @var Collection<UniverseCardInterface>
  22.      */
  23.     private Collection $universeCards;
  24.     public string $customPlainPassword;
  25.     public int $formMaxUserId;
  26.     public function __construct()
  27.     {
  28.         parent::__construct();
  29.         $this->universeCards = new ArrayCollection();
  30.     }
  31.     public function getMaxUserId(): int|null
  32.     {
  33.         return $this->maxUserId;
  34.     }
  35.     public function setMaxUserId(int|null $maxUserId): self
  36.     {
  37.         $this->maxUserId $maxUserId;
  38.         return $this;
  39.     }
  40.     public function getUniverseCards(): Collection
  41.     {
  42.         return $this->universeCards;
  43.     }
  44.     public function addUniverseCards(UniverseCardInterface $universeCard): void
  45.     {
  46.         if ($this->universeCards->contains($universeCard)) {
  47.             return;
  48.         }
  49.         $this->universeCards->add($universeCard);
  50.     }
  51.     public function removeUniverseCards(UniverseCardInterface $universeCard): void
  52.     {
  53.         if (! $this->universeCards->contains($universeCard)) {
  54.             return;
  55.         }
  56.         $this->universeCards->removeElement($universeCard);
  57.     }
  58. }