<?php
namespace App\Entity;
use ApiPlatform\Core\Annotation\ApiFilter;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\Common\Collections\Criteria;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Timestampable\Traits\TimestampableEntity;
use JMS\Serializer\Annotation as Serializer;
use Symfony\Component\HttpFoundation\File\UploadedFile;
use Symfony\Component\Routing\Generator\UrlGenerator;
use Symfony\Component\Routing\RouterInterface;
use Symfony\Component\Security\Core\User\UserInterface;
use Symfony\Component\Serializer\Annotation\Context;
use Symfony\Component\Serializer\Annotation\Ignore;
use Symfony\Component\Serializer\Annotation\MaxDepth;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
use ApiPlatform\Core\Annotation\ApiResource;
use Symfony\Component\Serializer\Annotation\Groups;
use ApiPlatform\Core\Annotation\ApiProperty;
use Symfony\Component\Serializer\Normalizer\DateTimeNormalizer;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\SearchFilter;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\BooleanFilter;
use App\Filter\PrePayableFilter;
use App\Filter\OnSaleFilter;
use OpenApi\Annotations as OA;
/**
* @ORM\Entity(repositoryClass="App\Repository\ShopRepository")
* @UniqueEntity("email")
* @UniqueEntity("tel")
*/
class Shop implements UserInterface
{
use TimestampableEntity;
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
* @Groups({"anonymouns:read"})
* @Groups({"user:read"})
*/
private $id;
/**
* @ORM\Column(type="string", length=180, unique=true)
* @Assert\Email()
* @Serializer\Exclude
* @Ignore()
*/
private $email;
/**
* @ORM\Column(type="json")
* @Serializer\Exclude
* @Ignore()
*/
private $roles = ['ROLE_USER'];
/**
* @var string The hashed password
* @ORM\Column(type="string")
* @Serializer\Exclude
* @Ignore()
*/
private $password;
/**
* @var string
* @Serializer\Exclude
* @Ignore()
*/
private $plainPassword;
/**
* @ORM\Column(type="string", length=255)
* @Assert\NotBlank()
* @Groups({"anonymouns:read"})
* @Groups({"user:read"})
*/
private $name;
/**
* @var Category[]|ArrayCollection
* @ORM\ManyToMany(targetEntity="App\Entity\Category", inversedBy="shops")
* @ORM\JoinTable(
* joinColumns={@ORM\JoinColumn(name="shop_id", referencedColumnName="id", onDelete="CASCADE")},
* inverseJoinColumns={@ORM\JoinColumn(name="category_id", referencedColumnName="id", onDelete="CASCADE")}
* )
* @Groups({"anonymouns:read"})
* @Groups({"user:read"})
* @Serializer\MaxDepth(1)
* @MaxDepth(1)
*/
private $categories;
/**
* @var Location
* @ORM\ManyToOne(targetEntity="App\Entity\Location", inversedBy="shops")
* @ORM\JoinColumn(nullable=true)
* @Serializer\MaxDepth(1)
* @MaxDepth(1)
* @Groups({"anonymouns:read"})
* @Groups({"user:read"})
*/
private $location;
/**
* @ORM\Column(type="boolean", nullable=true)
* @Groups({"anonymouns:read"})
* @Groups({"user:read"})
*/
private $toGo;
/**
* @ORM\Column(type="boolean", nullable=true)
* @Groups({"anonymouns:read"})
* @Groups({"user:read"})
*/
private $delivery;
/**
* @ORM\Column(type="string", length=16, nullable=true)
* @Groups({"anonymouns:read"})
* @Groups({"user:read"})
*/
private $zipcode;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Groups({"anonymouns:read"})
* @Groups({"user:read"})
*/
private $address;
/**
* @var Coordinate
* @ORM\Embedded(class="Coordinate")
* @Assert\Valid()
* @Groups({"anonymouns:read"})
* @Groups({"user:read", "coordinate"})
*/
private $coordinate;
/**
* @ORM\Column(type="string", length=16, unique=true)
* @Groups({"anonymouns:read"})
* @Groups({"user:read"})
*/
private $tel;
/**
* @ORM\Column(type="text", nullable=true)
* @Groups({"anonymouns:read"})
* @Groups({"user:read"})
*/
private $notice;
/**
* @var MenuGroup[]|ArrayCollection
* @ORM\OneToMany(targetEntity="App\Entity\MenuGroup", mappedBy="shop")
* @ORM\OrderBy({"position": "ASC"})
* @Serializer\Exclude
* @Ignore()
*/
private $menuGroups;
/**
* @var Menu[]|ArrayCollection
* @ORM\OneToMany(targetEntity="App\Entity\Menu", mappedBy="shop")
* @Groups({"anonymouns:read"})
* @Groups({"user:read"})
* @MaxDepth(1)
*/
private $menus;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Serializer\Exclude
* @Ignore()
*/
private $assignee;
/**
* 公開するかどうか
* @ORM\Column(type="boolean")
* @Serializer\Exclude
* @Ignore()
*/
private $public = true;
/**
* @var \DateTime
* @ORM\Column(type="time", nullable=true)
* @Context({DateTimeNormalizer::FORMAT_KEY="H:i"})
* @Ignore()
*/
private $hourFrom;
/**
* @var \DateTime
* @ORM\Column(type="time", nullable=true)
* @Context({DateTimeNormalizer::FORMAT_KEY="H:i"})
* @Ignore()
*/
private $hourTo;
/**
* @ORM\Column(type="integer", nullable=true)
* @Ignore()
*/
private $estimatedMinutes;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Serializer\Exclude
* @Ignore()
*/
private $resetToken;
/**
* @ORM\Column(type="boolean", options={"default": 1})
* @Serializer\Exclude
* @Ignore()
*/
private $ready = true;
/**
* @ORM\OneToMany(targetEntity=ShopPlanContractHistory::class, mappedBy="shop")
* @Serializer\Exclude
* @Ignore()
*/
private $shopPlanContractHistories;
/**
* 有料プランの次回請求日
*
* @ORM\Column(type="datetime", nullable=true)
* @Serializer\Exclude
* @Ignore()
*/
private $paidPlanNextBillingDate;
/**
* @ORM\ManyToOne(targetEntity=ShopPlan::class, inversedBy="shops")
* @Serializer\MaxDepth(1)
* @MaxDepth(1)
* @Groups({"anonymouns:read"})
* @Groups({"user:read"})
*/
private $shopPlan;
/**
* @ORM\OneToMany(targetEntity=PaymentMethod::class, mappedBy="shop")
* @Serializer\Exclude
* @Ignore()
*/
private $paymentMethods;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Serializer\Exclude
* @Ignore()
*/
private $gmoMemberId;
/**
* @ORM\OneToMany(targetEntity=Invoice::class, mappedBy="shop")
* @Serializer\Exclude
* @Ignore()
*/
private $invoices;
/**
* @ORM\OneToMany(targetEntity=Payment::class, mappedBy="shop")
* @Serializer\Exclude
* @Ignore()
*/
private $payments;
/**
* @ORM\OneToMany(targetEntity=Coupon::class, mappedBy="shop")
* @Serializer\Exclude
* @Ignore()
*/
private $coupons;
/**
* @ORM\OneToMany(targetEntity=Cart::class, mappedBy="shop")
* @Serializer\Exclude()
* @Ignore()
*/
private $carts;
/**
* @ORM\OneToMany(targetEntity=Order::class, mappedBy="shop")
* @Serializer\Exclude()
* @Ignore()
*/
private $orders;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Groups({"anonymouns:read"})
* @Groups({"user:read"})
*/
private $image;
/**
* @var UploadedFile
*/
private $ieImage;
/**
* @var string
*/
private $defaultImage;
/**
* @ORM\OneToMany(targetEntity=ShopReview::class, mappedBy="shop")
* @Serializer\Exclude
* @Ignore()
*/
private $shopReviews;
/**
* @Groups({"anonymouns:read"})
* @Groups({"user:read"})
*/
private $shopReviewCount;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $tokenValidAfter;
/**
* @ORM\Column(type="integer", nullable=true)
* @Groups({"anonymouns:read"})
* @Groups({"user:read"})
*/
private $appEstimatedMinutes;
/**
* @ORM\Column(type="time", nullable=true)
* @Groups({"anonymouns:read"})
* @Groups({"user:read"})
* @Context({DateTimeNormalizer::FORMAT_KEY="H:i"})
*/
private $appHourFrom;
/**
* @ORM\Column(type="time", nullable=true)
* @Groups({"anonymouns:read"})
* @Groups({"user:read"})
* @Context({DateTimeNormalizer::FORMAT_KEY="H:i"})
*/
private $appHourTo;
/**
* @Groups({"anonymouns:read"})
* @Groups({"user:read"})
*/
private $appAcceptable;
/**
* @ORM\Column(type="boolean", options={"default":0})
*/
private $appClosed = 0;
/**
* @ORM\Column(type="decimal", precision=2, scale=1, options={"default": 0.0})
* @Groups({"anonymouns:read"})
* @Groups({"user:read"})
*/
private $rate = 0.0;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Serializer\Exclude
* @Ignore()
*/
private $gmoShopId;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Serializer\Exclude
* @Ignore()
*/
private $gmoShopPassword;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Serializer\Exclude
* @Ignore()
*/
private $fcmToken;
/**
* 販売事業者名
*
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $lawName;
private $appLawName;
/**
* 販売事業者所在地
*
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $lawAddress;
private $appLawAddress;
/**
* 代表者
*
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $lawRepresentativeName;
private $appLawRepresentativeName;
/**
* 代表者フリガナ
*
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $lawRepresentativeNameKana;
private $appLawRepresentativeNameKana;
/**
* 連絡先/ホームページ
*
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $lawUrl;
private $appLawUrl;
/**
* 連絡先/電子メール
*
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $lawEmail;
private $appLawEmail;
/**
* 連絡先/電話番号
*
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $lawTel;
private $appLawTel;
/**
* 商品等の引き渡し時期(日数)・発送方法
*
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $lawDeliveryDaysAndShippingMethod;
private $appLawDeliveryDaysAndShippingMethod;
/**
* 代金の支払時期および方法
*
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $lawPaymentMethod;
private $appLawPaymentMethod;
/**
* 商品代金以外に必要な費用 /送料、消費税等
*
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $lawOtherCosts;
private $appLawOtherCosts;
/**
* 返品の取扱条件/返品期限、返品時の送料負担または解約や退会条件
*
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $lawReturnPolicy;
private $appLawReturnPolicy;
/**
* 不良品の取扱条件
*
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $lawDefectiveProduct;
private $appLawDefectiveProduct;
/**
* 退会について
*
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $lawUserDelete;
private $appLawUserDelete;
/**
* キャンセルについて
*
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $lawCancel;
private $appLawCancel;
/**
* @ORM\OneToMany(targetEntity=ShopSales::class, mappedBy="shop")
* @Serializer\Exclude
* @Ignore
*/
private $shopSales;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $bankName;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $bankCode;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $bankBranchName;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $bankBranchCode;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $bankAccountNumber;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $bankAccountType;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $bankAccountName;
/**
* Shop constructor.
*/
public function __construct()
{
$this->menuGroups = new ArrayCollection();
$this->menus = new ArrayCollection();
$this->categories = new ArrayCollection();
$this->coordinate = new Coordinate();
$this->shopPlanContractHistories = new ArrayCollection();
$this->paymentMethods = new ArrayCollection();
$this->invoices = new ArrayCollection();
$this->payments = new ArrayCollection();
$this->coupons = new ArrayCollection();
$this->carts = new ArrayCollection();
$this->orders = new ArrayCollection();
$this->shopReviews = new ArrayCollection();
$this->shopSales = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getEmail(): ?string
{
return $this->email;
}
public function setEmail(string $email): self
{
$this->email = $email;
return $this;
}
/**
* A visual identifier that represents this user.
*
* @see UserInterface
*/
public function getUsername(): string
{
return (string) $this->email;
}
/**
* @see UserInterface
*/
public function getRoles(): array
{
$roles = $this->roles;
// guarantee every user at least has ROLE_USER
$roles[] = 'ROLE_USER';
return array_unique($roles);
}
public function setRoles(array $roles): self
{
$this->roles = $roles;
return $this;
}
/**
* @see UserInterface
*/
public function getPassword(): string
{
return (string) $this->password;
}
public function setPassword(string $password): self
{
$this->password = $password;
return $this;
}
/**
* @see UserInterface
*/
public function getSalt()
{
// not needed when using the "bcrypt" algorithm in security.yaml
}
/**
* @see UserInterface
*/
public function eraseCredentials()
{
// If you store any temporary, sensitive data on the user, clear it here
// $this->plainPassword = null;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
public function getToGo(): ?bool
{
return $this->toGo;
}
public function setToGo(?bool $toGo): self
{
$this->toGo = $toGo;
return $this;
}
public function getDelivery(): ?bool
{
return $this->delivery;
}
public function setDelivery(?bool $delivery): self
{
$this->delivery = $delivery;
return $this;
}
public function getZipcode(): ?string
{
return $this->zipcode;
}
public function setZipcode(?string $zipcode): self
{
$this->zipcode = $zipcode;
return $this;
}
public function getAddress(): ?string
{
return $this->address;
}
public function setAddress(string $address): self
{
$this->address = $address;
return $this;
}
/**
* @return string
*/
public function getPlainPassword(): ?string
{
return $this->plainPassword;
}
/**
* @param string $plainPassword
*
* @return $this
*/
public function setPlainPassword($plainPassword)
{
$this->plainPassword = $plainPassword;
return $this;
}
public function getTel(): ?string
{
return $this->tel;
}
public function setTel(string $tel): self
{
$this->tel = $tel;
return $this;
}
public function getNotice(): ?string
{
return $this->notice;
}
public function setNotice(?string $notice): self
{
$this->notice = $notice;
return $this;
}
/**
* @return Menu[]|ArrayCollection
*/
public function getMenus()
{
return $this->menus;
}
/**
* @return Category[]|ArrayCollection
*/
public function getCategories()
{
return $this->categories;
}
/**
* @param Category[]|ArrayCollection $categories
*
* @return $this
*/
public function setCategories($categories)
{
$this->categories = $categories;
return $this;
}
public function addCategory(Category $category)
{
$this->categories->add($category);
return $this;
}
public function removeCategory(Category $category)
{
$this->categories->removeElement($category);
return $this;
}
/**
* @return Coordinate
*/
public function getCoordinate(): Coordinate
{
return $this->coordinate;
}
/**
* @param Coordinate $coordinate
*
* @return $this
*/
public function setCoordinate($coordinate)
{
$this->coordinate = $coordinate;
return $this;
}
/**
* @return Location
*/
public function getLocation(): ?Location
{
return $this->location;
}
/**
* @param Location $location
*
* @return $this
*/
public function setLocation($location)
{
$this->location = $location;
return $this;
}
/**
* @return MenuGroup[]|ArrayCollection
*/
public function getMenuGroups()
{
return $this->menuGroups;
}
public function getAssignee(): ?string
{
return $this->assignee;
}
public function setAssignee(?string $assignee): self
{
$this->assignee = $assignee;
return $this;
}
public function getPublic(): ?bool
{
return $this->public;
}
public function setPublic(bool $public): self
{
$this->public = $public;
return $this;
}
public function isValid(): bool
{
return (
$this->getName() &&
$this->getEmail() &&
$this->getLocation() &&
$this->getCategories()->count() > 0 &&
$this->getZipcode() &&
$this->getAddress() &&
$this->getTel()
);
}
public function checkReady(): bool
{
return $this->isValid() && ($this->getMenus()->count() > 0);
}
/**
* @return Menu[]|ArrayCollection
*/
public function getUngroupedMenus()
{
return $this->menus->matching(Criteria::create()
->andWhere(Criteria::expr()->isNull('group'))
->orderBy(['position' => 'ASC'])
);
}
public function getHourFrom(): ?\DateTimeInterface
{
return $this->hourFrom;
}
public function setHourFrom(\DateTimeInterface $hourFrom): self
{
$this->hourFrom = $hourFrom;
return $this;
}
public function getHourTo(): ?\DateTimeInterface
{
return $this->hourTo;
}
public function setHourTo(\DateTimeInterface $hourTo): self
{
$this->hourTo = $hourTo;
return $this;
}
public function getEstimatedMinutes(): ?int
{
return $this->estimatedMinutes;
}
public function setEstimatedMinutes(?int $estimatedMinutes): self
{
$this->estimatedMinutes = $estimatedMinutes;
return $this;
}
public function getResetToken(): ?string
{
return $this->resetToken;
}
public function setResetToken(?string $resetToken): self
{
$this->resetToken = $resetToken;
return $this;
}
public function isAcceptable(): bool
{
if (!$this->hourFrom || !$this->hourTo) {
return true;
}
$from = (int) $this->hourFrom->format('Hi');
$to = (int) $this->hourTo->format('Hi');
$now = (int) date('Hi');
if ($from == $to) {
return true;
}
if ($from < $to) {
return ($now >= $from && $now <= $to);
} else {
return ($now >= $from || $now <= $to);
}
}
public function isAppAcceptable(): bool
{
if ($this->getAppClosed()) {
return false;
}
$hourFrom = $this->getAppHourFrom();
$hourTo = $this->getAppHourTo();
if (!$hourFrom || !$hourTo) {
return true;
}
$from = (int) $hourFrom->format('Hi');
$to = (int) $hourTo->format('Hi');
$now = (int) date('Hi');
if ($from == $to) {
return true;
}
if ($from < $to) {
return ($now >= $from && $now <= $to);
} else {
return ($now >= $from || $now <= $to);
}
}
public function getReady(): ?bool
{
return $this->ready;
}
public function setReady(bool $ready): self
{
$this->ready = $ready;
return $this;
}
/**
* @return Collection|ShopPlanContractHistory[]
*/
public function getShopPlanContractHistories(): Collection
{
return $this->shopPlanContractHistories;
}
public function addShopPlanContractHistory(ShopPlanContractHistory $shopPlanContractHistory): self
{
if (!$this->shopPlanContractHistories->contains($shopPlanContractHistory)) {
$this->shopPlanContractHistories[] = $shopPlanContractHistory;
$shopPlanContractHistory->setShop($this);
}
return $this;
}
public function removeShopPlanContractHistory(ShopPlanContractHistory $shopPlanContractHistory): self
{
if ($this->shopPlanContractHistories->removeElement($shopPlanContractHistory)) {
// set the owning side to null (unless already changed)
if ($shopPlanContractHistory->getShop() === $this) {
$shopPlanContractHistory->setShop(null);
}
}
return $this;
}
public function getPaidPlanNextBillingDate(): ?\DateTimeInterface
{
return $this->paidPlanNextBillingDate;
}
public function setPaidPlanNextBillingDate(?\DateTimeInterface $paidPlanNextBillingDate): self
{
$this->paidPlanNextBillingDate = $paidPlanNextBillingDate;
return $this;
}
public function getShopPlan(): ?ShopPlan
{
return $this->shopPlan;
}
public function setShopPlan(?ShopPlan $shopPlan): self
{
$this->shopPlan = $shopPlan;
return $this;
}
/**
* @return PaymentMethod|null
* @Ignore()
*/
public function getPrimaryPaymentMethod(): ?PaymentMethod
{
if ($this->getPaymentMethods()->count()) {
return $this->getPaymentMethods()->first();
}
return null;
}
/**
* @return Collection|PaymentMethod[]
*/
public function getPaymentMethods(): Collection
{
return $this->paymentMethods;
}
public function addPaymentMethod(PaymentMethod $paymentMethod): self
{
if (!$this->paymentMethods->contains($paymentMethod)) {
$this->paymentMethods[] = $paymentMethod;
$paymentMethod->setShop($this);
}
return $this;
}
public function removePaymentMethod(PaymentMethod $paymentMethod): self
{
if ($this->paymentMethods->removeElement($paymentMethod)) {
// set the owning side to null (unless already changed)
if ($paymentMethod->getShop() === $this) {
$paymentMethod->setShop(null);
}
}
return $this;
}
public function getGmoMemberId(): ?string
{
return $this->gmoMemberId;
}
public function setGmoMemberId(?string $gmoMemberId): self
{
$this->gmoMemberId = $gmoMemberId;
return $this;
}
/**
* @return Collection|Invoice[]
*/
public function getInvoices(): Collection
{
return $this->invoices;
}
public function addInvoice(Invoice $invoice): self
{
if (!$this->invoices->contains($invoice)) {
$this->invoices[] = $invoice;
$invoice->setShop($this);
}
return $this;
}
public function removeInvoice(Invoice $invoice): self
{
if ($this->invoices->removeElement($invoice)) {
// set the owning side to null (unless already changed)
if ($invoice->getShop() === $this) {
$invoice->setShop(null);
}
}
return $this;
}
/**
* @return Collection|Payment[]
*/
public function getPayments(): Collection
{
return $this->payments;
}
public function addPayment(Payment $payment): self
{
if (!$this->payments->contains($payment)) {
$this->payments[] = $payment;
$payment->setShop($this);
}
return $this;
}
public function removePayment(Payment $payment): self
{
if ($this->payments->removeElement($payment)) {
// set the owning side to null (unless already changed)
if ($payment->getShop() === $this) {
$payment->setShop(null);
}
}
return $this;
}
/**
* @return Collection|Coupon[]
*/
public function getCoupons(): Collection
{
return $this->coupons;
}
public function addCoupon(Coupon $coupon): self
{
if (!$this->coupons->contains($coupon)) {
$this->coupons[] = $coupon;
$coupon->setShop($this);
}
return $this;
}
public function removeCoupon(Coupon $coupon): self
{
if ($this->coupons->removeElement($coupon)) {
// set the owning side to null (unless already changed)
if ($coupon->getShop() === $this) {
$coupon->setShop(null);
}
}
return $this;
}
/**
* @return Collection|Cart[]
*/
public function getCarts(): Collection
{
return $this->carts;
}
public function addCart(Cart $cart): self
{
if (!$this->carts->contains($cart)) {
$this->carts[] = $cart;
$cart->setShop($this);
}
return $this;
}
public function removeCart(Cart $cart): self
{
if ($this->carts->removeElement($cart)) {
// set the owning side to null (unless already changed)
if ($cart->getShop() === $this) {
$cart->setShop(null);
}
}
return $this;
}
/**
* @return Collection|Order[]
*/
public function getOrders(): Collection
{
return $this->orders;
}
public function addOrder(Order $order): self
{
if (!$this->orders->contains($order)) {
$this->orders[] = $order;
$order->setShop($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->getShop() === $this) {
$order->setShop(null);
}
}
return $this;
}
public function getImage(): ?string
{
return $this->image;
}
public function setImage(?string $image): self
{
$this->image = $image;
return $this;
}
public function getDefaultImage(): ?string
{
return $this->defaultImage;
}
public function setDefaultImage(?string $image): self
{
$this->defaultImage = $image;
return $this;
}
/**
* @return UploadedFile
*/
public function getIeImage(): ?UploadedFile
{
return $this->ieImage;
}
/**
* @param UploadedFile $ieImage
*
* @return $this
*/
public function setIeImage($ieImage)
{
$this->ieImage = $ieImage;
return $this;
}
/**
* @return Collection|ShopReview[]
*/
public function getShopReviews(): Collection
{
return $this->shopReviews;
}
public function addShopReview(ShopReview $shopReview): self
{
if (!$this->shopReviews->contains($shopReview)) {
$this->shopReviews[] = $shopReview;
$shopReview->setShop($this);
}
return $this;
}
public function removeShopReview(ShopReview $shopReview): self
{
if ($this->shopReviews->removeElement($shopReview)) {
// set the owning side to null (unless already changed)
if ($shopReview->getShop() === $this) {
$shopReview->setShop(null);
}
}
return $this;
}
public function getShopReviewCount()
{
return $this->getShopReviews()->count();
}
public function getTokenValidAfter(): ?\DateTimeInterface
{
return $this->tokenValidAfter;
}
public function setTokenValidAfter(?\DateTimeInterface $tokenValidAfter): self
{
$this->tokenValidAfter = $tokenValidAfter;
return $this;
}
public function getAppEstimatedMinutes(): ?int
{
if (! $this->appEstimatedMinutes) {
return $this->getEstimatedMinutes();
}
return $this->appEstimatedMinutes;
}
public function setAppEstimatedMinutes(?int $appEstimatedMinutes): self
{
$this->appEstimatedMinutes = $appEstimatedMinutes;
return $this;
}
public function getAppHourFrom(): ?\DateTimeInterface
{
if (! $this->appHourFrom) {
return $this->getHourFrom();
}
return $this->appHourFrom;
}
public function setAppHourFrom(?\DateTimeInterface $appHourFrom): self
{
$this->appHourFrom = $appHourFrom;
return $this;
}
public function getAppHourTo(): ?\DateTimeInterface
{
if (! $this->appHourTo) {
return $this->getHourTo();
}
return $this->appHourTo;
}
public function setAppHourTo(?\DateTimeInterface $appHourTo): self
{
$this->appHourTo = $appHourTo;
return $this;
}
public function getAppClosed(): ?bool
{
return $this->appClosed;
}
public function setAppClosed(bool $appClosed): self
{
$this->appClosed = $appClosed;
return $this;
}
public function getRate(): ?string
{
return $this->rate;
}
public function setRate(string $rate): self
{
$this->rate = $rate;
return $this;
}
public function getGmoShopId(): ?string
{
return $this->gmoShopId;
}
public function setGmoShopId(?string $gmoShopId): self
{
$this->gmoShopId = $gmoShopId;
return $this;
}
public function getGmoShopPassword(): ?string
{
return $this->gmoShopPassword;
}
public function setGmoShopPassword(?string $gmoShopPassword): self
{
$this->gmoShopPassword = $gmoShopPassword;
return $this;
}
public function getFcmToken(): ?string
{
return $this->fcmToken;
}
public function setFcmToken(?string $fcmToken): self
{
$this->fcmToken = $fcmToken;
return $this;
}
public function getLawName(): ?string
{
return $this->lawName;
}
public function getAppLawName(): ?string
{
if (! $this->getLawName()) {
return $this->getName();
}
return $this->getLawName();
}
public function setLawName(?string $lawName): self
{
$this->lawName = $lawName;
return $this;
}
public function getLawAddress(): ?string
{
return $this->lawAddress;
}
public function getAppLawAddress(): ?string
{
if (! $this->getLawAddress()) {
return $this->getZipcode(). ' '. $this->getAddress();
}
return $this->getLawAddress();
}
public function setLawAddress(?string $lawAddress): self
{
$this->lawAddress = $lawAddress;
return $this;
}
public function getLawRepresentativeName(): ?string
{
return $this->lawRepresentativeName;
}
public function getAppLawRepresentativeName(): ?string
{
return $this->getLawRepresentativeName();
}
public function setLawRepresentativeName(?string $lawRepresentativeName): self
{
$this->lawRepresentativeName = $lawRepresentativeName;
return $this;
}
public function getLawRepresentativeNameKana(): ?string
{
return $this->lawRepresentativeNameKana;
}
public function getAppLawRepresentativeNameKana(): ?string
{
return $this->getLawRepresentativeNameKana();
}
public function setLawRepresentativeNameKana(?string $lawRepresentativeNameKana): self
{
$this->lawRepresentativeNameKana = $lawRepresentativeNameKana;
return $this;
}
public function getLawUrl(): ?string
{
return $this->lawUrl;
}
public function getAppLawUrl(): ?string
{
return $this->getLawUrl();
}
public function setLawUrl(?string $lawUrl): self
{
$this->lawUrl = $lawUrl;
return $this;
}
public function getLawEmail(): ?string
{
return $this->lawEmail;
}
public function getAppLawEmail(): ?string
{
if (! $this->getLawEmail()) {
return $this->getEmail();
}
return $this->getLawEmail();
}
public function setLawEmail(?string $lawEmail): self
{
$this->lawEmail = $lawEmail;
return $this;
}
public function getLawTel(): ?string
{
return $this->lawTel;
}
public function getAppLawTel(): ?string
{
if (! $this->getLawTel()) {
return $this->getTel();
}
return $this->getLawTel();
}
public function setLawTel(?string $lawTel): self
{
$this->lawTel = $lawTel;
return $this;
}
public function getLawDeliveryDaysAndShippingMethod(): ?string
{
return $this->lawDeliveryDaysAndShippingMethod;
}
public function getAppLawDeliveryDaysAndShippingMethod(): ?string
{
return $this->getLawDeliveryDaysAndShippingMethod();
}
public function setLawDeliveryDaysAndShippingMethod(?string $lawDeliveryDaysAndShippingMethod): self
{
$this->lawDeliveryDaysAndShippingMethod = $lawDeliveryDaysAndShippingMethod;
return $this;
}
public function getLawPaymentMethod(): ?string
{
return $this->lawPaymentMethod;
}
public function getAppLawPaymentMethod(): ?string
{
return $this->getLawPaymentMethod();
}
public function setLawPaymentMethod(?string $lawPaymentMethod): self
{
$this->lawPaymentMethod = $lawPaymentMethod;
return $this;
}
public function getLawOtherCosts(): ?string
{
return $this->lawOtherCosts;
}
public function getAppLawOtherCosts(): ?string
{
return $this->getLawOtherCosts();
}
public function setLawOtherCosts(?string $lawOtherCosts): self
{
$this->lawOtherCosts = $lawOtherCosts;
return $this;
}
public function getLawReturnPolicy(): ?string
{
return $this->lawReturnPolicy;
}
public function getAppLawReturnPolicy(): ?string
{
return $this->getLawReturnPolicy();
}
public function setLawReturnPolicy(?string $lawReturnPolicy): self
{
$this->lawReturnPolicy = $lawReturnPolicy;
return $this;
}
public function getLawDefectiveProduct(): ?string
{
return $this->lawDefectiveProduct;
}
public function getAppLawDefectiveProduct(): ?string
{
return $this->getLawDefectiveProduct();
}
public function setLawDefectiveProduct(?string $lawDefectiveProduct): self
{
$this->lawDefectiveProduct = $lawDefectiveProduct;
return $this;
}
/**
* @return Collection|ShopSales[]
*/
public function getShopSales(): Collection
{
return $this->shopSales;
}
public function addShopSale(ShopSales $shopSale): self
{
if (!$this->shopSales->contains($shopSale)) {
$this->shopSales[] = $shopSale;
$shopSale->setShop($this);
}
return $this;
}
public function removeShopSale(ShopSales $shopSale): self
{
if ($this->shopSales->removeElement($shopSale)) {
// set the owning side to null (unless already changed)
if ($shopSale->getShop() === $this) {
$shopSale->setShop(null);
}
}
return $this;
}
public function getBankName(): ?string
{
return $this->bankName;
}
public function setBankName(?string $bankName): self
{
$this->bankName = $bankName;
return $this;
}
public function getBankCode(): ?string
{
return $this->bankCode;
}
public function setBankCode(?string $bankCode): self
{
$this->bankCode = $bankCode;
return $this;
}
public function getBankBranchName(): ?string
{
return $this->bankBranchName;
}
public function setBankBranchName(?string $bankBranchName): self
{
$this->bankBranchName = $bankBranchName;
return $this;
}
public function getBankBranchCode(): ?string
{
return $this->bankBranchCode;
}
public function setBankBranchCode(?string $bankBranchCode): self
{
$this->bankBranchCode = $bankBranchCode;
return $this;
}
public function getBankAccountNumber(): ?string
{
return $this->bankAccountNumber;
}
public function setBankAccountNumber(?string $bankAccountNumber): self
{
$this->bankAccountNumber = $bankAccountNumber;
return $this;
}
public function getBankAccountType(): ?string
{
return $this->bankAccountType;
}
public function setBankAccountType(?string $bankAccountType): self
{
$this->bankAccountType = $bankAccountType;
return $this;
}
public function getBankAccountName(): ?string
{
return $this->bankAccountName;
}
public function setBankAccountName(?string $bankAccountName): self
{
$this->bankAccountName = $bankAccountName;
return $this;
}
public function getLawUserDelete(): ?string
{
return $this->lawUserDelete;
}
public function getAppLawUserDelete(): ?string
{
return $this->getLawUserDelete();
}
public function setLawUserDelete(?string $lawUserDelete): self
{
$this->lawUserDelete = $lawUserDelete;
return $this;
}
public function getLawCancel(): ?string
{
return $this->lawCancel;
}
public function getAppLawCancel(): ?string
{
return $this->getLawCancel();
}
public function setLawCancel(?string $lawCancel): self
{
$this->lawCancel = $lawCancel;
return $this;
}
}