src/AppBundle/MainBundle/Entity/WP_Availability_Days.php line 140

Open in your IDE?
  1. <?php
  2. /**
  3.  * Created by PhpStorm.
  4.  * User: apple
  5.  * Date: 29/03/19
  6.  * Time: 2:55 PM
  7.  */
  8. namespace App\AppBundle\MainBundle\Entity;
  9. use Doctrine\ORM\Mapping as ORM;
  10. use Symfony\Component\Validator\Constraints as Assert;
  11. use JsonSerializable;
  12. /**
  13.  * AddOns
  14.  *
  15.  * @ORM\Entity
  16.  * @ORM\Table(name="wp_availability_days")
  17.  * @ORM\HasLifecycleCallbacks()
  18.  */
  19. class WP_Availability_Days  implements JsonSerializable
  20. {
  21.     /**
  22.      * @ORM\Column(type="integer")
  23.      * @ORM\Id
  24.      * @ORM\GeneratedValue(strategy="AUTO")
  25.      */
  26.     private $id;
  27.     /**
  28.      * @ORM\Column(type="string", nullable=false)
  29.      * @Assert\NotBlank()
  30.      */
  31.     private $name;
  32.     /**
  33.      * @ORM\Column(type="integer", nullable=false)
  34.      * @Assert\NotBlank()
  35.      */
  36.     private $week_day_id;
  37.     /**
  38.      * @ORM\Column(type="boolean", nullable=false)
  39.      * @Assert\NotBlank()
  40.      */
  41.     private $active;
  42.     /**
  43.      * @ORM\Column(type="integer", nullable=false)
  44.      * @Assert\NotBlank()
  45.      */
  46.     private $seq_number;
  47.     /**
  48.      * @return mixed
  49.      */
  50.     public function getId()
  51.     {
  52.         return $this->id;
  53.     }
  54.     /**
  55.      * @return mixed
  56.      */
  57.     public function getName()
  58.     {
  59.         return $this->name;
  60.     }
  61.     /**
  62.      * @param mixed $name
  63.      */
  64.     public function setName($name)
  65.     {
  66.         $this->name $name;
  67.     }
  68.     /**
  69.      * @return mixed
  70.      */
  71.     public function getActive()
  72.     {
  73.         return $this->active;
  74.     }
  75.     /**
  76.      * @param mixed $active
  77.      */
  78.     public function setActive($active)
  79.     {
  80.         $this->active $active;
  81.     }
  82.     /**
  83.      * @return mixed
  84.      */
  85.     public function getSeqNumber()
  86.     {
  87.         return $this->seq_number;
  88.     }
  89.     /**
  90.      * @param mixed $seq_number
  91.      */
  92.     public function setSeqNumber($seq_number)
  93.     {
  94.         $this->seq_number $seq_number;
  95.     }
  96.     /**
  97.      * @return mixed
  98.      */
  99.     public function getWeekDayId()
  100.     {
  101.         return $this->week_day_id;
  102.     }
  103.     /**
  104.      * @param mixed $week_day_id
  105.      */
  106.     public function setWeekDayId($week_day_id)
  107.     {
  108.         $this->week_day_id $week_day_id;
  109.     }
  110.     public function jsonSerialize()
  111.     {
  112.         return array(
  113.             'id' => $this->id,
  114.             'seq_number' => $this->seq_number,
  115.             'active' => $this->active,
  116.             'name' => $this->name,
  117.             'week_day_id' => $this->week_day_id
  118.         );
  119.     }
  120.     /**
  121.      * @var string $created
  122.      *
  123.      * @ORM\Column(name="created_at", type="string", nullable=false)
  124.      */
  125.     protected $createdAt;
  126.     /**
  127.      * @var string $updated
  128.      *
  129.      * @ORM\Column(name="updated_at", type="string", nullable=false)
  130.      */
  131.     protected $updatedAt;
  132.     public function getCreatedAt()
  133.     {
  134.         return $this->createdAt;
  135.     }
  136.     public function setCreatedAt($createdAt)
  137.     {
  138.         $this->createdAt $createdAt;
  139.         return $this;
  140.     }
  141.     public function getUpdatedAt()
  142.     {
  143.         return $this->updatedAt;
  144.     }
  145.     public function setUpdatedAt($updatedAt)
  146.     {
  147.         $this->updatedAt $updatedAt;
  148.         return $this;
  149.     }
  150.     /**
  151.      * @ORM\PrePersist
  152.      * @ORM\PreUpdate
  153.      */
  154.     public function updatedTimestamps()
  155.     {
  156.         $this->setUpdatedAt(round(microtime(true) * 1000));
  157.         if ($this->getCreatedAt() === null) {
  158.             $this->setCreatedAt(round(microtime(true) * 1000));
  159.         }
  160.     }
  161.     public function __construct() {
  162.         $this->setCreatedAt(round(microtime(true) * 1000));
  163.     }
  164. }