src/Daikin/BaseBundle/Entity/EmergencyStock/Warehouse.php line 18

Open in your IDE?
  1. <?php
  2. namespace App\Daikin\BaseBundle\Entity\EmergencyStock;
  3. use App\Daikin\BaseBundle\Entity\AbstractBaseEntity;
  4. use App\Daikin\BaseBundle\Entity\AddressTrait;
  5. use App\Daikin\BaseBundle\Entity\GeoCoordinateInterface;
  6. use App\Daikin\BaseBundle\Entity\GeoCoordinateTrait;
  7. use App\Daikin\BaseBundle\Entity\SparePartsPart;
  8. use DateTime;
  9. use Doctrine\Common\Collections\ArrayCollection;
  10. use Doctrine\ORM\Mapping as ORM;
  11. /**
  12.  * @ORM\Table(name="warehouse")
  13.  * @ORM\Entity(repositoryClass="App\Daikin\BaseBundle\Repository\EmergencyStock\WarehouseRepository")
  14.  */
  15. class Warehouse extends AbstractBaseEntity implements GeoCoordinateInterface
  16. {
  17.     use AddressTraitGeoCoordinateTrait;
  18.     /**
  19.      * @var DateTime|null
  20.      * @ORM\Column(name="start_time", type="datetime", nullable=true)
  21.      */
  22.     protected $startTime;
  23.     /**
  24.      * @var DateTime|null
  25.      * @ORM\Column(name="end_time", type="datetime", nullable=true)
  26.      */
  27.     protected $endTime;
  28.     /**
  29.      * @var string
  30.      *
  31.      * @ORM\Column(name="locationName", type="string")
  32.      */
  33.     private $locationName;
  34.     /**
  35.      * @var string
  36.      *
  37.      * @ORM\Column(type="string", nullable=true)
  38.      */
  39.     private $company;
  40.     /**
  41.      * @var string
  42.      *
  43.      * @ORM\Column(type="string", nullable=true)
  44.      */
  45.     private $email;
  46.     /**
  47.      * @var string
  48.      *
  49.      * @ORM\Column(type="string", nullable=true)
  50.      */
  51.     private $phone;
  52.     /**
  53.      * @var string
  54.      *
  55.      * @ORM\Column(name="contactPerson", type="string", nullable=true)
  56.      */
  57.     private $contactPerson;
  58.     /**
  59.      * @var string
  60.      *
  61.      * @ORM\Column(type="string", unique=true)
  62.      */
  63.     private $account;
  64.     /**
  65.      * @var string
  66.      *
  67.      * @ORM\Column(type="string", unique=true)
  68.      */
  69.     private $customer;
  70.     /**
  71.      * @var string
  72.      *
  73.      * @ORM\Column(type="string")
  74.      */
  75.     private $password;
  76.     /**
  77.      * @var string
  78.      *
  79.      * @ORM\Column(name="sessionId", type="string")
  80.      */
  81.     private $sessionId;
  82.     public function __construct()
  83.     {
  84.         parent::__construct();
  85.     }
  86.     /**
  87.      * @return DateTime|null
  88.      */
  89.     public function getStartTime(): ?DateTime
  90.     {
  91.         return $this->startTime;
  92.     }
  93.     /**
  94.      * @param DateTime|null $startTime
  95.      * @return Warehouse
  96.      */
  97.     public function setStartTime(?DateTime $startTime): Warehouse
  98.     {
  99.         $this->startTime $startTime;
  100.         return $this;
  101.     }
  102.     /**
  103.      * @return DateTime|null
  104.      */
  105.     public function getEndTime(): ?DateTime
  106.     {
  107.         return $this->endTime;
  108.     }
  109.     /**
  110.      * @param DateTime|null $endTime
  111.      * @return Warehouse
  112.      */
  113.     public function setEndTime(?DateTime $endTime): Warehouse
  114.     {
  115.         $this->endTime $endTime;
  116.         return $this;
  117.     }
  118.     public function isActiveForShipping(): bool
  119.     {
  120.         if ($this->isDeleted()) {
  121.             return false;
  122.         }
  123.         $now = new DateTime();
  124.         if ($this->getEndTime() && $this->getEndTime() < $now) {
  125.             return false;
  126.         }
  127.         if ($this->getStartTime() && $this->getStartTime() > $now) {
  128.             return false;
  129.         }
  130.         return true;
  131.     }
  132.     /**
  133.      * @return string
  134.      */
  135.     public function getLocationName()
  136.     {
  137.         return $this->locationName;
  138.     }
  139.     /**
  140.      * @param string $locationName
  141.      * @return Warehouse
  142.      */
  143.     public function setLocationName($locationName)
  144.     {
  145.         $this->locationName $locationName;
  146.         return $this;
  147.     }
  148.     /**
  149.      * @return string
  150.      */
  151.     public function getEmail()
  152.     {
  153.         return $this->email;
  154.     }
  155.     /**
  156.      * @param string $email
  157.      * @return Warehouse
  158.      */
  159.     public function setEmail($email)
  160.     {
  161.         $this->email $email;
  162.         return $this;
  163.     }
  164.     /**
  165.      * @return string
  166.      */
  167.     public function getPhone()
  168.     {
  169.         return $this->phone;
  170.     }
  171.     /**
  172.      * @param string $phone
  173.      * @return Warehouse
  174.      */
  175.     public function setPhone($phone)
  176.     {
  177.         $this->phone $phone;
  178.         return $this;
  179.     }
  180.     /**
  181.      * @return string
  182.      */
  183.     public function getContactPerson()
  184.     {
  185.         return $this->contactPerson;
  186.     }
  187.     /**
  188.      * @param string $contactPerson
  189.      * @return Warehouse
  190.      */
  191.     public function setContactPerson($contactPerson)
  192.     {
  193.         $this->contactPerson $contactPerson;
  194.         return $this;
  195.     }
  196.     /**
  197.      * @return string
  198.      */
  199.     public function getAccount()
  200.     {
  201.         return $this->account;
  202.     }
  203.     /**
  204.      * @param string $account
  205.      * @return Warehouse
  206.      */
  207.     public function setAccount($account)
  208.     {
  209.         $this->account $account;
  210.         return $this;
  211.     }
  212.     /**
  213.      * @return string
  214.      */
  215.     public function getCustomer()
  216.     {
  217.         return $this->customer;
  218.     }
  219.     /**
  220.      * @param string $customer
  221.      * @return Warehouse
  222.      */
  223.     public function setCustomer($customer)
  224.     {
  225.         $this->customer $customer;
  226.         return $this;
  227.     }
  228.     /**
  229.      * @return string
  230.      */
  231.     public function getCompany()
  232.     {
  233.         return $this->company;
  234.     }
  235.     /**
  236.      * @param string $company
  237.      * @return Warehouse
  238.      */
  239.     public function setCompany($company)
  240.     {
  241.         $this->company $company;
  242.         return $this;
  243.     }
  244.     /**
  245.      * @return string
  246.      */
  247.     public function getPassword()
  248.     {
  249.         return $this->password;
  250.     }
  251.     /**
  252.      * @param string $password
  253.      */
  254.     public function setPassword($password)
  255.     {
  256.         $this->password $password;
  257.     }
  258.     /**
  259.      * @return string
  260.      */
  261.     public function getSessionId()
  262.     {
  263.         return $this->sessionId;
  264.     }
  265.     /**
  266.      * @param string $sessionId
  267.      * @return Warehouse
  268.      */
  269.     public function setSessionId($sessionId)
  270.     {
  271.         $this->sessionId $sessionId;
  272.         return $this;
  273.     }
  274. }