src/Domain/Site/Model/Site.php line 17

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Domain\Site\Model;
  4. use App\Domain\Merchant\Model\Merchant;
  5. use App\Domain\Payment\Model\Payment;
  6. use App\Domain\PaymentGateway\Model\PaymentGatewayConfig;
  7. use App\Domain\Shared\Model\TimestampTrait;
  8. use Doctrine\Common\Collections\ArrayCollection;
  9. use Doctrine\Common\Collections\Collection;
  10. use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
  11. use Symfony\Component\Security\Core\User\UserInterface;
  12. use Symfony\Component\Uid\Uuid;
  13. class Site implements UserInterfacePasswordAuthenticatedUserInterface
  14. {
  15.     use TimestampTrait;
  16.     /**
  17.      * @var Collection<array-key, Payment>
  18.      */
  19.     private Collection $payments;
  20.     public function __construct(
  21.         private Uuid $id,
  22.         private Merchant $merchant,
  23.         private PaymentGatewayConfig $paymentGatewayConfig,
  24.         private BillingInformation $billingInformation,
  25.         private string $password,
  26.         private string $name,
  27.         private string $description,
  28.         private bool $active,
  29.         private string $secret,
  30.     ) {
  31.         $this->payments = new ArrayCollection();
  32.         $this->createdAt = new \DateTimeImmutable();
  33.         $this->updatedAt null;
  34.     }
  35.     public function getCreatedAt(): \DateTimeImmutable
  36.     {
  37.         return $this->createdAt;
  38.     }
  39.     public function setCreatedAt(\DateTimeImmutable $createdAt): void
  40.     {
  41.         $this->createdAt $createdAt;
  42.     }
  43.     public function getUpdatedAt()
  44.     {
  45.         return $this->updatedAt;
  46.     }
  47.     public function setUpdatedAt($updatedAt): void
  48.     {
  49.         $this->updatedAt $updatedAt;
  50.     }
  51.     public function getId(): Uuid
  52.     {
  53.         return $this->id;
  54.     }
  55.     public function setId(Uuid $id): void
  56.     {
  57.         $this->id $id;
  58.     }
  59.     public function getMerchant(): Merchant
  60.     {
  61.         return $this->merchant;
  62.     }
  63.     public function setMerchant(Merchant $merchant): void
  64.     {
  65.         $this->merchant $merchant;
  66.     }
  67.     public function getName(): string
  68.     {
  69.         return $this->name;
  70.     }
  71.     public function setName(string $name): void
  72.     {
  73.         $this->name $name;
  74.     }
  75.     public function getDescription(): string
  76.     {
  77.         return $this->description;
  78.     }
  79.     public function setDescription(string $description): void
  80.     {
  81.         $this->description $description;
  82.     }
  83.     public function isActive(): bool
  84.     {
  85.         return $this->active;
  86.     }
  87.     public function setActive(bool $active): void
  88.     {
  89.         $this->active $active;
  90.     }
  91.     public function getSecret(): string
  92.     {
  93.         return $this->secret;
  94.     }
  95.     public function setSecret(string $secret): void
  96.     {
  97.         $this->secret $secret;
  98.     }
  99.     public function getPassword(): string
  100.     {
  101.         return $this->password;
  102.     }
  103.     public function setPassword(string $password): void
  104.     {
  105.         $this->password $password;
  106.     }
  107.     public function getRoles(): array
  108.     {
  109.         return [SiteRole::SITE->value];
  110.     }
  111.     public function eraseCredentials() {}
  112.     public function getUserIdentifier(): string
  113.     {
  114.         return (string) $this->id;
  115.     }
  116.     public function getPaymentGatewayConfig(): PaymentGatewayConfig
  117.     {
  118.         return $this->paymentGatewayConfig;
  119.     }
  120.     public function setPaymentGatewayConfig(PaymentGatewayConfig $paymentGatewayConfig): void
  121.     {
  122.         $this->paymentGatewayConfig $paymentGatewayConfig;
  123.     }
  124.     public function getBillingInformation(): BillingInformation
  125.     {
  126.         return $this->billingInformation;
  127.     }
  128.     public function setBillingInformation(BillingInformation $billingInformation): void
  129.     {
  130.         $this->billingInformation $billingInformation;
  131.     }
  132. }