<?php
namespace App\Entity;
use App\Validator\Constraints as AppAssert;
use App\Classes\Hasher;
use App\Entity\Product\Product;
use App\Model\ProtectedInterface;
use Cocur\Slugify\Slugify;
use DateTime;
use DateTimeImmutable;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
use Exception;
use Gedmo\Mapping\Annotation as Gedmo;
use JMS\Serializer\Annotation as Serializer;
use JMS\Serializer\Annotation\ExclusionPolicy;
use JMS\Serializer\Annotation\Expose;
use Symfony\Component\Security\Core\User\UserInterface;
use Symfony\Component\Validator\Constraints as Assert;
use Vich\UploaderBundle\Mapping\Annotation as Vich;
/**
* Class Supplier
*
* @ORM\Entity(repositoryClass="App\Repository\SupplierRepository")
* @ORM\Table(name="malys_supplier")
* @ORM\HasLifecycleCallbacks()
* @ExclusionPolicy("all")
* @Vich\Uploadable
* @AppAssert\Supplier(groups={"all"})
* @Serializer\VirtualProperty(
* "emailAddress",
* exp="object.getEmailAddress() ? object.getEmailAddress().getAddress() : null"
* )
*/
class Supplier implements UserInterface, ProtectedInterface
{
public const SUGGEST_ARGS_MAX_SIZE = 300;
public const SHORT_DELIVERY_AREA_MAX_SIZE = 45;
public const STATUS_UNTRUSTED = "untrusted";
public const STATUS_TRUSTED = "trusted";
public const STATUS_PARTNER = "partner";
public const STATUSES = [
'Guest à confirmer' => self::STATUS_UNTRUSTED,
'Guest confirmé' => self::STATUS_TRUSTED,
'Partenaire' => self::STATUS_PARTNER
];
/**
* @var integer
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
* @Expose
*/
protected $id;
/**
* @var string
*
* @ORM\Column(name="company_name", type="string", length=255, nullable=false)
* @Expose
* @Assert\NotBlank(message="Veuillez indiquer le nom du fournisseur")
*/
protected $companyName;
/**
* @var string
*
* @ORM\Column(name="short_company_name", type="string", length=255, nullable=true)
* @Expose
*/
protected $shortCompanyName;
/**
* @var string
*
* @ORM\Column(name="logo", type="string", nullable=true)
*/
protected $picture;
/**
* Not persisted
* @Vich\UploadableField(mapping="supplier_picture", fileNameProperty="picture")
*/
private $pictureFile;
/**
* @var EmailAddress
*
* Serialized as virtual property (address property)
*
* @ORM\ManyToOne(targetEntity="EmailAddress", cascade={"persist"})
* @ORM\JoinColumn(name="email_address_id", referencedColumnName="id")
* @Assert\Valid(groups={"Default"})
*/
protected $emailAddress;
/**
* @var string
*
* @ORM\Column(name="apikey", type="string", nullable=true)
*/
protected $apikey;
/**
* @var string
*
* @ORM\Column(name="account_opening_time", type="string", length=255, nullable=true)
*/
protected $accountOpeningTime;
/**
* @var string
*
* @ORM\Column(name="address", type="string", nullable=true)
* @Expose
*/
protected $address;
/**
* @var string
*
* @ORM\Column(name="zip_code", type="string", nullable=true)
* @Expose
*/
protected $zipCode;
/**
* @var string
*
* @ORM\Column(name="city", type="string", nullable=true)
* @Expose
*/
protected $city;
/**
* @var string
*
* @ORM\Column(name="country", type="string", nullable=true)
* @Expose
*/
protected $country;
/**
* @var string
*
* @ORM\Column(name="short_description", type="text", nullable=true)
* @Expose
*/
protected $shortDescription;
/**
* @var string
*
* @ORM\Column(name="comment", type="text", nullable=true)
*/
protected $comment;
/**
* @var float
* @ORM\Column(name="minimum_tax_excluded", type="float", nullable=true)
* @Assert\NotBlank(groups={"api"})
* @Expose
*/
protected $minimumTaxExcluded;
/**
* @var ArrayCollection
*
* @ORM\OneToMany(targetEntity="DeliveryModel", mappedBy="supplier", cascade={"remove", "persist"})
*/
protected $deliveriesModel;
/**
* @var string
*
* @ORM\Column(name="phone", type="string", nullable=true)
* @Expose
*/
protected $phone;
/**
* @var string
*
* @ORM\Column(name="mobile", type="string", nullable=true)
* @Expose
*/
protected $mobile;
/**
* @var ArrayCollection
*
* @ORM\OneToMany(targetEntity="SupplierContact", mappedBy="supplier", cascade={"remove"})
*/
protected $contacts;
/**
* @var boolean
*
* @ORM\Column(name="enabled", type="boolean", options={"default" : true})
* @Expose
*/
protected $enabled = true;
/**
* @var boolean
*
* @ORM\Column(name="orders_enabled", type="boolean", options={"default" : true})
* @Expose
*/
protected $ordersEnabled = true;
/**
* @var string
*
* @ORM\Column(name="orders_comment", type="text", nullable=true)
* @Expose
*/
protected $ordersComment;
/**
* @var ArrayCollection
*
* @ORM\OneToMany(targetEntity="App\Entity\Product\Product", mappedBy="supplier", cascade={"remove"})
*/
protected $products;
/**
* @var boolean
*
* @ORM\Column(name="primeur", type="boolean", options={"default" : false}, nullable=true)
* @Expose
*/
protected $primeur = false;
/**
* @var string
*
* @ORM\Column(name="website", type="string", nullable=true)
* @Expose
*/
protected $website;
/**
* @var ArrayCollection
*
* @ORM\OneToMany(targetEntity="SupplierCustomer", mappedBy="supplier", cascade={"remove"})
*/
protected $customers;
/**
* @var mixed
*
* @ORM\OneToMany(targetEntity="SupplierCustomerNoTP", mappedBy="supplier", cascade={"remove"})
*/
protected $noTPCustomers;
/**
* @var ArrayCollection
*
* @ORM\OneToMany(targetEntity="SupplierProductService", mappedBy="supplier", cascade={"all"}, orphanRemoval=true)
*/
protected $productServices;
/**
* @var boolean
*/
protected $associatedToCustomer = false;
/**
* @var DateTime
*
* @ORM\Column(name="createdAt", type="datetime", nullable=false)
*/
protected $createdAt;
/**
* @var DateTime
*
* @ORM\Column(name="updatedAt", type="datetime", nullable=true)
*/
protected $updatedAt;
/**
* @Gedmo\Slug(fields={"companyName"})
* @ORM\Column(length=128, unique=true)
*/
protected $slug;
/**
* @var string
*
* @ORM\Column(name="cgu_file", type="string", nullable=true)
*/
protected $cguFile;
/**
* @var string
*
* @ORM\Column(name="suggest_arg1", type="text", nullable=true)
* @Assert\Length(max=Supplier::SUGGEST_ARGS_MAX_SIZE, groups={"all", "api"})
* @Expose
*/
protected $suggestArgumentOne;
/**
* @var string
*
* @ORM\Column(name="suggest_arg2", type="text", nullable=true)
* @Assert\Length(max=Supplier::SUGGEST_ARGS_MAX_SIZE, groups={"all", "api"})
* @Expose
*/
protected $suggestArgumentTwo;
/**
* @var string
*
* @ORM\Column(name="suggest_arg3", type="text", nullable=true)
* @Assert\Length(max=Supplier::SUGGEST_ARGS_MAX_SIZE, groups={"all", "api"})
* @Expose
*/
protected $suggestArgumentThree;
/**
* @var string
*
* @ORM\Column(name="suggest_arg4", type="text", nullable=true)
* @Assert\Length(max=Supplier::SUGGEST_ARGS_MAX_SIZE, groups={"all", "api"})
* @Expose
*/
protected $suggestArgumentFour;
/**
* @var array
*
* @ORM\Column(name="working_days", type="simple_array", nullable=true)
* @Expose
*/
protected $workingDays;
/**
* @var string
*
* @ORM\Column(name="status", type="string", length=255, nullable=false, options={"default"=App\Entity\Supplier::STATUS_UNTRUSTED})
* @Assert\Choice(choices=Supplier::STATUSES, message="The status you chose is forbidden", groups={"all", "api"})
* @Expose
*/
protected $status = self::STATUS_UNTRUSTED;
/**
* @var string
*
* @ORM\Column(name="color", type="string", length=255, nullable=true)
*/
protected $color;
/**
* @ORM\ManyToMany(targetEntity="App\Entity\Customer", mappedBy="suggestedSuppliers")
*/
protected $suggestedForCustomers;
/**
* @ORM\Column(name="product_families", type="string", length=255, nullable=true)
* @Expose
*/
protected $productFamilies;
/**
* @ORM\Column(name="precise_delivery_area", type="string", length=255, nullable=true)
*/
protected $preciseDeliveryArea;
/**
* @ORM\Column(name="short_delivery_area", type="string", length=255, nullable=true)
* @Expose
*/
protected $shortDeliveryArea;
/**
* @var ArrayCollection
*
* @ORM\OneToMany(targetEntity="Webhook", mappedBy="supplier", cascade={"remove"})
*/
protected $webhooks;
/**
* @ORM\Column(name="hashed_id", type="string", nullable=false)
*/
protected $hashedId;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Invoice", mappedBy="supplier")
*/
protected $invoices;
/**
* @ORM\OneToMany(targetEntity="App\Entity\SupplierHoliday", mappedBy="supplier")
*/
protected $holidays;
/**
* @ORM\Column(name="receive_products_from_interface", type="boolean", options={"default" : false})
*/
protected $receiveProductsFromInterface = false;
/**
* @ORM\Column(name="send_orders_to_interface", type="boolean", options={"default" : false})
*/
protected $sendOrdersToInterface = false;
/**
* @ORM\Column(name="send_orders_by_email", type="boolean", options={"default" : true})
*/
protected $sendOrdersByEmail = true;
/**
* Supplier constructor.
*/
public function __construct()
{
$this->contacts = new ArrayCollection();
$this->deliveriesModel = new ArrayCollection();
$this->products = new ArrayCollection();
$this->customers = new ArrayCollection();
$this->productServices = new ArrayCollection();
$this->suggestedForCustomers = new ArrayCollection();
$this->webhooks = new ArrayCollection();
$this->invoices = new ArrayCollection();
}
public function __toString()
{
return $this->companyName;
}
/**
* @ORM\PrePersist
*/
public function prePersist()
{
if ($this->companyName == null) {
$this->companyName = 'Nouveau fournisseur';
}
}
/**
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* @param int $id
*/
public function setId($id)
{
$this->id = $id;
}
/**
* @return string
*/
public function getCompanyName()
{
return $this->companyName;
}
/**
* @param string $companyName
*
*/
public function setCompanyName($companyName)
{
$this->companyName = $companyName;
}
/**
* @return string
*/
public function getPicture()
{
return $this->picture;
}
/**
* @param string $picture
*/
public function setPicture($picture)
{
$this->picture = $picture;
}
public function setPictureFile($pictureFile = null)
{
$this->pictureFile = $pictureFile;
if (null !== $pictureFile) {
$this->updatedAt = new DateTimeImmutable();
}
}
public function getPictureFile()
{
return $this->pictureFile;
}
/**
* @return EmailAddress|null
*/
public function getEmailAddress(): ?EmailAddress
{
return $this->emailAddress;
}
/**
* @param EmailAddress|null $emailAddress
*/
public function setEmailAddress(?EmailAddress $emailAddress)
{
$this->emailAddress = $emailAddress;
}
/**
* @return string
*/
public function getAccountOpeningTime()
{
return $this->accountOpeningTime;
}
/**
* @param string $accountOpeningTime
*/
public function setAccountOpeningTime($accountOpeningTime)
{
$this->accountOpeningTime = $accountOpeningTime;
}
/**
* @return string
*/
public function getAddress()
{
return $this->address;
}
/**
* @param string $address
*/
public function setAddress($address)
{
$this->address = $address;
}
/**
* @return string
*/
public function getZipCode()
{
return $this->zipCode;
}
/**
* @param string $zipCode
*/
public function setZipCode($zipCode)
{
$this->zipCode = $zipCode;
}
/**
* @return string
*/
public function getCity()
{
return $this->city;
}
/**
* @param string $city
*/
public function setCity($city)
{
$this->city = $city;
}
/**
* @return string
*/
public function getCountry()
{
return $this->country;
}
/**
* @param string $country
*/
public function setCountry($country)
{
$this->country = $country;
}
/**
* @return string
*/
public function getShortDescription()
{
return $this->shortDescription;
}
/**
* @param string $shortDescription
*/
public function setShortDescription($shortDescription)
{
$this->shortDescription = $shortDescription;
}
/**
* @return string
*/
public function getComment()
{
return $this->comment;
}
/**
* @param string $comment
*/
public function setComment($comment)
{
$this->comment = $comment;
}
/**
* @return float
*/
public function getMinimumTaxExcluded()
{
return $this->minimumTaxExcluded;
}
/**
* @param float $minimumTaxExcluded
*/
public function setMinimumTaxExcluded($minimumTaxExcluded)
{
$this->minimumTaxExcluded = $minimumTaxExcluded;
}
/**
* @return string
*/
public function getPhone()
{
return $this->phone;
}
/**
* @param string $phone
*/
public function setPhone($phone)
{
$this->phone = $phone;
}
/**
* @return string
*/
public function getMobile()
{
return $this->mobile;
}
/**
* @param string $mobile
*/
public function setMobile($mobile)
{
$this->mobile = $mobile;
}
/**
* @return ArrayCollection
*/
public function getContacts()
{
return $this->contacts;
}
/**
* @param ArrayCollection $contacts
*/
public function setContacts($contacts)
{
$this->contacts = $contacts;
}
/**
* @param SupplierContact $contact
*/
public function addContact($contact)
{
$this->contacts->add($contact);
}
/**
* @param SupplierContact $contact
*/
public function removeContact($contact)
{
if ($this->contacts->contains($contact)) {
$this->contacts->removeElement($contact);
}
}
/**
* @return ArrayCollection
*/
public function getDeliveriesModel()
{
return $this->deliveriesModel;
}
/**
* @param ArrayCollection $deliveriesModel
*/
public function setDeliveriesModel($deliveriesModel)
{
$this->deliveriesModel = $deliveriesModel;
}
/**
* @param DeliveryModel $deliveryModel
*/
public function addDeliveryModel(DeliveryModel $deliveryModel)
{
$this->deliveriesModel->add($deliveryModel);
}
/**
* @param DeliveryModel $deliveryModel
*/
public function removeDeliveryModel(DeliveryModel $deliveryModel)
{
if ($this->deliveriesModel->contains($deliveryModel)) {
$this->deliveriesModel->removeElement($deliveryModel);
}
}
/**
* @return bool
*/
public function isPrimeur()
{
return $this->primeur;
}
/**
* @param bool $primeur
*/
public function setPrimeur($primeur)
{
$this->primeur = $primeur;
}
/**
* @return string
*/
public function getWebsite()
{
return $this->website;
}
/**
* @param string $website
*/
public function setWebsite($website)
{
$this->website = $website;
}
/**
* @return mixed
*/
public function getProducts()
{
return $this->products;
}
/**
* @param mixed $products
*/
public function setProducts($products)
{
$this->products = $products;
}
/**
* @param Product $product
*/
public function addProduct($product)
{
$this->products->add($product);
}
/**
* @param Product $product
*/
public function removeProduct($product)
{
if ($this->products->contains($product)) {
$this->products->removeElement($product);
}
}
/**
* @return bool
*/
public function isEnabled()
{
return $this->enabled;
}
/**
* @param bool $enabled
*/
public function setEnabled($enabled)
{
$this->enabled = $enabled;
}
/**
* @return ArrayCollection
*/
public function getCustomers()
{
return $this->customers;
}
/**
* @param ArrayCollection $customers
*/
public function setCustomers($customers)
{
$this->customers = $customers;
}
/**
* @return bool
*/
public function isAssociatedToCustomer()
{
return $this->associatedToCustomer;
}
/**
* @param bool $associatedToCustomer
*/
public function setAssociatedToCustomer($associatedToCustomer)
{
$this->associatedToCustomer = $associatedToCustomer;
}
/**
* @return DateTime
*/
public function getCreatedAt()
{
return $this->createdAt;
}
/**
* Set createdAt
*
* @return Supplier
* @ORM\PrePersist
* @throws Exception
*/
public function setCreatedAt()
{
$this->createdAt = new DateTime();
$this->updatedAt = new DateTime();
return $this;
}
/**
* @return DateTime
*/
public function getUpdatedAt()
{
return $this->updatedAt;
}
/**
* Set updatedAt
*
* @return Supplier
* @ORM\PreUpdate
* @throws Exception
*/
public function setUpdatedAt()
{
$this->updatedAt = new DateTime();
return $this;
}
/**
* @return string
*/
public function getFirstContactPhone()
{
$firstContactPhone = 'Non renseigné';
if (! empty($this->getContacts()) && isset($this->getContacts()[0])) {
$firstContactPhone = $this->getContacts()[0]->getMobile();
}
return $firstContactPhone;
}
/**
* @return string
*/
public function getFirstContactEmail()
{
$firstContactEmail = 'Non renseigné';
if (! empty($this->getContacts()) && isset($this->getContacts()[0])) {
$firstContactEmail = $this->getContacts()[0]->getEmail();
}
return $firstContactEmail;
}
/**
* @return string
*/
public function getDirectoryName()
{
$slugify = new Slugify();
return $this->getId() . '_' . $slugify->slugify($this->getCompanyName());
}
/**
* @return mixed
*/
public function getSlug()
{
return $this->slug;
}
/**
* @param mixed $slug
*/
public function setSlug($slug)
{
$this->slug = $slug;
}
/**
* @return string
*/
public function getCguFile()
{
return $this->cguFile;
}
/**
* @param string $cguFile
*/
public function setCguFile($cguFile)
{
$this->cguFile = $cguFile;
}
/**
* @return ArrayCollection
*/
public function getProductServices()
{
return $this->productServices;
}
/**
* @param ArrayCollection $productServices
*/
public function setProductServices($productServices)
{
$this->productServices = $productServices;
}
public function addProductService($productService)
{
$productService->setSupplier($this);
$this->productServices->add($productService);
}
public function removeProductService($productService)
{
if ($this->productServices->contains($productService)) {
$this->productServices->removeElement($productService);
}
}
/**
* @return string
*/
public function getShortCompanyName()
{
return $this->shortCompanyName;
}
/**
* @param string $shortCompanyName
*/
public function setShortCompanyName($shortCompanyName)
{
$this->shortCompanyName = $shortCompanyName;
}
/**
* @return string
*/
public function getSuggestArgumentOne()
{
return $this->suggestArgumentOne;
}
/**
* @param string $suggestArgumentOne
*/
public function setSuggestArgumentOne($suggestArgumentOne)
{
$this->suggestArgumentOne = $suggestArgumentOne;
}
/**
* @return string
*/
public function getSuggestArgumentTwo()
{
return $this->suggestArgumentTwo;
}
/**
* @param string $suggestArgumentTwo
*/
public function setSuggestArgumentTwo($suggestArgumentTwo)
{
$this->suggestArgumentTwo = $suggestArgumentTwo;
}
/**
* @return string
*/
public function getSuggestArgumentThree()
{
return $this->suggestArgumentThree;
}
/**
* @param string $suggestArgumentThree
*/
public function setSuggestArgumentThree($suggestArgumentThree)
{
$this->suggestArgumentThree = $suggestArgumentThree;
}
/**
* @return string
*/
public function getSuggestArgumentFour()
{
return $this->suggestArgumentFour;
}
/**
* @param string $suggestArgumentFour
*/
public function setSuggestArgumentFour($suggestArgumentFour)
{
$this->suggestArgumentFour = $suggestArgumentFour;
}
/**
* @return array
*/
public function getWorkingDays()
{
return $this->workingDays;
}
/**
* @param array $workingDays
*/
public function setWorkingDays($workingDays)
{
$this->workingDays = $workingDays;
}
/**
* @return string
*/
public function getStatus()
{
return $this->status;
}
/**
* @param $status
*/
public function setStatus($status)
{
$this->status = $status;
}
/**
* @return string
*/
public function getColor()
{
return $this->color;
}
/**
* @param string $color
*/
public function setColor($color)
{
$this->color = $color;
}
/**
* @return bool
*/
public function isOrdersEnabled(): bool
{
return $this->ordersEnabled;
}
/**
* @param bool $ordersEnabled
*/
public function setOrdersEnabled(bool $ordersEnabled)
{
$this->ordersEnabled = $ordersEnabled;
}
/**
* @return string
*/
public function getOrdersComment(): ?string
{
return $this->ordersComment;
}
/**
* @param string $ordersComment
*/
public function setOrdersComment(?string $ordersComment)
{
$this->ordersComment = $ordersComment;
}
/**
* @return ArrayCollection|Customer[]
*/
public function getSuggestedForCustomers()
{
return $this->suggestedForCustomers;
}
/**
* @param mixed $suggestedForCustomers
*/
public function setSuggestedSuppliers($suggestedForCustomers)
{
$this->suggestedForCustomers = $suggestedForCustomers;
}
/**
* @return string|null
*/
public function getProductFamilies(): ?string
{
return $this->productFamilies;
}
/**
* @param string $productFamilies
*/
public function setProductFamilies(?string $productFamilies)
{
$this->productFamilies = $productFamilies;
}
/**
* @return string|null
*/
public function getPreciseDeliveryArea()
{
return $this->preciseDeliveryArea;
}
/**
* @param string $preciseDeliveryArea
*/
public function setPreciseDeliveryArea($preciseDeliveryArea)
{
$this->preciseDeliveryArea = $preciseDeliveryArea;
}
/**
* @return mixed
*/
public function getShortDeliveryArea()
{
return $this->shortDeliveryArea;
}
/**
* @param mixed $shortDeliveryArea
*/
public function setShortDeliveryArea($shortDeliveryArea): void
{
$this->shortDeliveryArea = $shortDeliveryArea;
}
/**
* @param string|null $hashedId
*
* @return Supplier
*/
public function setHashedId(?string $hashedId): Supplier
{
$this->hashedId = $hashedId;
return $this;
}
/**
* @return string|null
*/
public function getHashedId(): ?string
{
return $this->hashedId;
}
/**
* @ORM\PrePersist
*/
public function installHashedId()
{
if (is_null($this->hashedId)) {
$this->hashedId = Hasher::generateHash(self::class);
}
}
public function getRoles(): array
{
return [ 'ROLE_USER', 'ROLE_SUPPIER' ];
}
public function getPassword():?string
{
}
public function getSalt():?string
{
}
// Used for API
public function getUsername(): string
{
return $this->getHashedId();
}
public function eraseCredentials()
{
}
/**
* @return ArrayCollection
*/
public function getWebhooks()
{
return $this->webhooks;
}
/**
* @param ArrayCollection $webhooks
*/
public function setWebhooks($webhooks)
{
$this->webhooks = $webhooks;
}
/**
* @param Webhook $webhook
*/
public function addWebhook($webhook)
{
$this->webhooks->add($webhook);
}
/**
* @param Webhook $webhook
*/
public function removeWebhook($webhook)
{
if ($this->webhooks->contains($webhook)) {
$this->webhooks->removeElement($webhook);
}
}
/**
* @return string
*/
public function getApikey(): string
{
return $this->apikey;
}
/**
* @param string $apikey
*/
public function setApikey(string $apikey): void
{
$this->apikey = $apikey;
}
/**
* @return mixed
*/
public function getHolidays()
{
return $this->holidays;
}
/**
* @return ArrayCollection
*/
public function getInvoices()
{
return $this->invoices;
}
/**
* @return mixed
*/
public function getNoTPCustomers()
{
return $this->noTPCustomers;
}
/**
* @param mixed $noTPCustomers
*/
public function setNoTPCustomers($noTPCustomers): void
{
$this->noTPCustomers = $noTPCustomers;
}
/**
* @return bool
*/
public function isReceiveProductsFromInterface(): bool
{
return $this->receiveProductsFromInterface;
}
/**
* @param bool $receiveProductsFromInterface
*/
public function setReceiveProductsFromInterface(bool $receiveProductsFromInterface): void
{
$this->receiveProductsFromInterface = $receiveProductsFromInterface;
}
/**
* @return bool
*/
public function isSendOrdersToInterface(): bool
{
return $this->sendOrdersToInterface;
}
/**
* @param bool $sendOrdersToInterface
*/
public function setSendOrdersToInterface(bool $sendOrdersToInterface): void
{
$this->sendOrdersToInterface = $sendOrdersToInterface;
}
/**
* @return bool
*/
public function isSendOrdersByEmail(): bool
{
return $this->sendOrdersByEmail;
}
/**
* @param bool $sendOrdersByEmail
*/
public function setSendOrdersByEmail(bool $sendOrdersByEmail): void
{
$this->sendOrdersByEmail = $sendOrdersByEmail;
}
public function isDeletable(): bool
{
return in_array($this->getStatus(), [
self::STATUS_UNTRUSTED,
self::STATUS_TRUSTED
]);
}
}