src/Daikin/BaseBundle/Entity/EmergencyStock/PartConstructionYear.php line 21

Open in your IDE?
  1. <?php
  2. namespace App\Daikin\BaseBundle\Entity\EmergencyStock;
  3. use App\Daikin\BaseBundle\Entity\SparePartsModel;
  4. use App\Daikin\BaseBundle\Entity\SparePartsPart;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7.  * Class PartConstructionYear
  8.  * @package App\Daikin\BaseBundle\Entity\EmergencyStock
  9.  *
  10.  * @ORM\Entity()
  11.  * @ORM\Table(
  12.  *     name="part_construction_year",
  13.  *     uniqueConstraints={@ORM\UniqueConstraint(columns={
  14.  *             "model_id", "sparePartsPart_id"
  15.  *     })}
  16.  * )
  17.  */
  18. class PartConstructionYear
  19. {
  20.     /**
  21.      * @var integer
  22.      *
  23.      * @ORM\Id()
  24.      * @ORM\Column(type="integer")
  25.      * @ORM\GeneratedValue(strategy="AUTO")
  26.      */
  27.     private $id;
  28.     /**
  29.      * @var integer
  30.      *
  31.      * @ORM\Column(name="fromMonth", type="integer", nullable=true)
  32.      */
  33.     private $fromMonth;
  34.     /**
  35.      * @var integer
  36.      *
  37.      * @ORM\Column(name="fromYear", type="integer", nullable=true)
  38.      */
  39.     private $fromYear;
  40.     /**
  41.      * @var integer
  42.      *
  43.      * @ORM\Column(name="toMonth", type="integer", nullable=true)
  44.      */
  45.     private $toMonth;
  46.     /**
  47.      * @var integer
  48.      *
  49.      * @ORM\Column(name="toYear", type="integer", nullable=true)
  50.      */
  51.     private $toYear;
  52.     /**
  53.      * @var SparePartsModel
  54.      *
  55.      * @ORM\ManyToOne(targetEntity="App\Daikin\BaseBundle\Entity\SparePartsModel")
  56.      * @ORM\JoinColumn()
  57.      */
  58.     private $model;
  59.     /**
  60.      * @var SparePartsPart
  61.      *
  62.      * @ORM\ManyToOne(targetEntity="App\Daikin\BaseBundle\Entity\SparePartsPart", inversedBy="partConstructionYears")
  63.      * @ORM\JoinColumn(name="sparePartsPart_id")
  64.      */
  65.     private $sparePartsPart;
  66.     /**
  67.      * @return int
  68.      */
  69.     public function getId()
  70.     {
  71.         return $this->id;
  72.     }
  73.     /**
  74.      * @param int $id
  75.      * @return PartConstructionYear
  76.      */
  77.     public function setId($id)
  78.     {
  79.         $this->id $id;
  80.         return $this;
  81.     }
  82.     /**
  83.      * @return int
  84.      */
  85.     public function getFromMonth()
  86.     {
  87.         return $this->fromMonth;
  88.     }
  89.     /**
  90.      * @param int $fromMonth
  91.      * @return PartConstructionYear
  92.      */
  93.     public function setFromMonth($fromMonth)
  94.     {
  95.         $this->fromMonth $fromMonth;
  96.         return $this;
  97.     }
  98.     /**
  99.      * @return int
  100.      */
  101.     public function getFromYear()
  102.     {
  103.         return $this->fromYear;
  104.     }
  105.     /**
  106.      * @param int $fromYear
  107.      * @return PartConstructionYear
  108.      */
  109.     public function setFromYear($fromYear)
  110.     {
  111.         $this->fromYear $fromYear;
  112.         return $this;
  113.     }
  114.     /**
  115.      * @return int
  116.      */
  117.     public function getToMonth()
  118.     {
  119.         return $this->toMonth;
  120.     }
  121.     /**
  122.      * @param int $toMonth
  123.      * @return PartConstructionYear
  124.      */
  125.     public function setToMonth($toMonth)
  126.     {
  127.         $this->toMonth $toMonth;
  128.         return $this;
  129.     }
  130.     /**
  131.      * @return int
  132.      */
  133.     public function getToYear()
  134.     {
  135.         return $this->toYear;
  136.     }
  137.     /**
  138.      * @param int $toYear
  139.      * @return PartConstructionYear
  140.      */
  141.     public function setToYear($toYear)
  142.     {
  143.         $this->toYear $toYear;
  144.         return $this;
  145.     }
  146.     /**
  147.      * @return SparePartsModel
  148.      */
  149.     public function getModel()
  150.     {
  151.         return $this->model;
  152.     }
  153.     /**
  154.      * @param SparePartsModel $model
  155.      * @return PartConstructionYear
  156.      */
  157.     public function setModel($model)
  158.     {
  159.         $this->model $model;
  160.         return $this;
  161.     }
  162.     /**
  163.      * @return SparePartsPart
  164.      */
  165.     public function getSparePartsPart()
  166.     {
  167.         return $this->sparePartsPart;
  168.     }
  169.     /**
  170.      * @param SparePartsPart $sparePartsPart
  171.      * @return PartConstructionYear
  172.      */
  173.     public function setSparePartsPart($sparePartsPart)
  174.     {
  175.         $this->sparePartsPart $sparePartsPart;
  176.         return $this;
  177.     }
  178.     /**
  179.      * @return bool
  180.      */
  181.     public function hasEmptyFrom(){
  182.         return empty($this->getFromMonth()) && empty($this->getFromYear());
  183.     }
  184.     /**
  185.      * @return bool
  186.      */
  187.     public function hasEmptyTo(){
  188.         return empty($this->getToMonth()) && empty($this->getToYear());
  189.     }
  190.     /**
  191.      * @return bool
  192.      */
  193.     public function hasInvalidTo(){
  194.         return empty($this->getToMonth()) || empty($this->getToYear());
  195.     }
  196.     /**
  197.      * @return bool
  198.      */
  199.     public function hasInvalidFrom(){
  200.         return empty($this->getFromMonth()) || empty($this->getFromYear());
  201.     }
  202. }