src/IlaveU/ShopBundle/Entity/Store/Store.php line 26
<?phpnamespace App\IlaveU\ShopBundle\Entity\Store;use ApiPlatform\Metadata\ApiResource;use App\Entity\User;use App\IlaveU\ShopBundle\Entity\Customer\Customer;use App\IlaveU\ShopBundle\Entity\Order\Order;use App\IlaveU\ShopBundle\Entity\Product\Product;use App\IlaveU\ShopBundle\Entity\Resource\Agent;use App\IlaveU\ShopBundle\Entity\Shipping\City;use App\IlaveU\ShopBundle\Entity\Shipping\CityRegion;use App\IlaveU\ShopBundle\Entity\Shipping\Shipment;use App\IlaveU\ShopBundle\Entity\Shipping\CashBox;use App\Repository\IlaveU\ShopBundle\Entity\Store\StoreRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;use Symfony\Component\Validator\Constraints as Assert;use Gedmo\Mapping\Annotation as Gedmo;#[ORM\Entity(repositoryClass: StoreRepository::class)]#[ApiResource]#[Gedmo\SoftDeleteable(fieldName: 'deletedAt', timeAware: false, hardDelete: true)]class Store{#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\Column(length: 255)]private ?string $name = null;#[ORM\Column(length: 255)]#[Gedmo\Slug(fields: ['name'])]private ?string $code = null;#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]private ?\DateTimeInterface $createdAt = null;#[ORM\Column(type: Types::TEXT, nullable: true)]private ?string $description = null;#[ORM\ManyToOne(inversedBy: 'stores')]#[ORM\JoinColumn(nullable: false)]private ?City $city = null;#[ORM\OneToOne(cascade: ['persist', 'remove'])]#[ORM\JoinColumn(nullable: false)]#[Assert\Valid]private ?User $user = null;#[ORM\ManyToOne(inversedBy: 'stores')]#[ORM\JoinColumn(nullable: true)]private ?CityRegion $cityRegion = null;#[ORM\Column(length: 255, nullable: true)]private ?string $storeType = null;#[ORM\OneToMany(mappedBy: 'store', targetEntity: CashBox::class)]private Collection $cashBoxes;#[ORM\OneToMany(mappedBy: 'collectedByStore', targetEntity: Shipment::class)]private Collection $collectedShipments;#[ORM\OneToMany(mappedBy: 'shippedByStore', targetEntity: Shipment::class)]private Collection $shippedShipments;#[ORM\OneToMany(mappedBy: 'store', targetEntity: Product::class)]private Collection $products;#[ORM\OneToMany(mappedBy: 'store', targetEntity: Order::class)]private Collection $orders;#[ORM\OneToMany(mappedBy: 'store', targetEntity: Agent::class)]private Collection $agents;#[ORM\OneToMany(mappedBy: 'store', targetEntity: Customer::class)]private Collection $customers;#[ORM\Column(nullable: true)]private ?\DateTimeImmutable $deletedAt = null;#[ORM\OneToMany(mappedBy: 'store', targetEntity: User::class)]private Collection $users;public function __toString(){return (string)$this->name;}public function __construct(){$this->user = new User();$this->cashBoxes = new ArrayCollection();$this->collectedShipments = new ArrayCollection();$this->shippedShipments = new ArrayCollection();$this->products = new ArrayCollection();$this->orders = new ArrayCollection();$this->agents = new ArrayCollection();$this->customers = new ArrayCollection();$this->users = new ArrayCollection();}public function getId(): ?int{return $this->id;}public function getName(): ?string{return $this->name;}public function setName(string $name): self{$this->name = $name;return $this;}public function getCode(): ?string{return $this->code;}public function setCode(?string $code): self{$this->code = $code;return $this;}public function getCreatedAt(): ?\DateTimeInterface{return $this->createdAt;}public function setCreatedAt(?\DateTimeInterface $createdAt): self{$this->createdAt = $createdAt;return $this;}public function getDescription(): ?string{return $this->description;}public function setDescription(?string $description): self{$this->description = $description;return $this;}public function getCity(): ?City{return $this->city;}public function setCity(?City $city): self{$this->city = $city;return $this;}public function getUser(): ?User{return $this->user;}public function setUser(User $user): self{$this->user = $user;return $this;}public function getCityRegion(): ?CityRegion{return $this->cityRegion;}public function setCityRegion(?CityRegion $cityRegion): self{$this->cityRegion = $cityRegion;return $this;}public function getStoreType(): ?string{return $this->storeType;}public function setStoreType(?string $storeType): self{$this->storeType = $storeType;return $this;}/*** @return Collection<int, CashBox>*/public function getCashBoxes(): Collection{return $this->cashBoxes;}public function addCashBox(CashBox $cashBox): self{if (!$this->cashBoxes->contains($cashBox)) {$this->cashBoxes->add($cashBox);$cashBox->setStore($this);}return $this;}public function removeCashBox(CashBox $cashBox): self{if ($this->cashBoxes->removeElement($cashBox)) {// set the owning side to null (unless already changed)if ($cashBox->getStore() === $this) {$cashBox->setStore(null);}}return $this;}/*** @return Collection<int, Shipment>*/public function getCollectedShipments(): Collection{return $this->collectedShipments;}public function addCollectedShipment(Shipment $collectedShipment): self{if (!$this->collectedShipments->contains($collectedShipment)) {$this->collectedShipments->add($collectedShipment);$collectedShipment->setCollectedByStore($this);}return $this;}public function removeCollectedShipment(Shipment $collectedShipment): self{if ($this->collectedShipments->removeElement($collectedShipment)) {// set the owning side to null (unless already changed)if ($collectedShipment->getCollectedByStore() === $this) {$collectedShipment->setCollectedByStore(null);}}return $this;}/*** @return Collection<int, Shipment>*/public function getShippedShipments(): Collection{return $this->shippedShipments;}public function addShippedShipment(Shipment $shippedShipment): self{if (!$this->shippedShipments->contains($shippedShipment)) {$this->shippedShipments->add($shippedShipment);$shippedShipment->setShippedByStore($this);}return $this;}public function removeShippedShipment(Shipment $shippedShipment): self{if ($this->shippedShipments->removeElement($shippedShipment)) {// set the owning side to null (unless already changed)if ($shippedShipment->getShippedByStore() === $this) {$shippedShipment->setShippedByStore(null);}}return $this;}/*** @return Collection<int, Product>*/public function getProducts(): Collection{return $this->products;}public function addProduct(Product $product): self{if (!$this->products->contains($product)) {$this->products->add($product);$product->setStore($this);}return $this;}public function removeProduct(Product $product): self{if ($this->products->removeElement($product)) {// set the owning side to null (unless already changed)if ($product->getStore() === $this) {$product->setStore(null);}}return $this;}/*** @return Collection<int, Order>*/public function getOrders(): Collection{return $this->orders;}public function addOrder(Order $order): self{if (!$this->orders->contains($order)) {$this->orders->add($order);$order->setStore($this);}return $this;}public function removeOrder(Order $order): self{if ($this->orders->removeElement($order)) {// set the owning side to null (unless already changed)if ($order->getStore() === $this) {$order->setStore(null);}}return $this;}/*** @return Collection<int, Agent>*/public function getAgents(): Collection{return $this->agents;}public function addAgent(Agent $agent): self{if (!$this->agents->contains($agent)) {$this->agents->add($agent);$agent->setStore($this);}return $this;}public function removeAgent(Agent $agent): self{if ($this->agents->removeElement($agent)) {// set the owning side to null (unless already changed)if ($agent->getStore() === $this) {$agent->setStore(null);}}return $this;}/*** @return Collection<int, Customer>*/public function getCustomers(): Collection{return $this->customers;}public function addCustomer(Customer $customer): self{if (!$this->customers->contains($customer)) {$this->customers->add($customer);$customer->setStore($this);}return $this;}public function removeCustomer(Customer $customer): self{if ($this->customers->removeElement($customer)) {// set the owning side to null (unless already changed)if ($customer->getStore() === $this) {$customer->setStore(null);}}return $this;}/*** Get the value of deletedAt*/public function getDeletedAt(){return $this->deletedAt;}/*** Set the value of deletedAt** @return self*/public function setDeletedAt($deletedAt){$this->deletedAt = $deletedAt;return $this;}/*** @return Collection<int, User>*/public function getUsers(): Collection{return $this->users;}public function addUser(User $user): static{if (!$this->users->contains($user)) {$this->users->add($user);$user->setStore($this);}return $this;}public function removeUser(User $user): static{if ($this->users->removeElement($user)) {// set the owning side to null (unless already changed)if ($user->getStore() === $this) {$user->setStore(null);}}return $this;}}