src/AppBundle/MainBundle/Entity/Orders_Suppliers_Transfers_Status.php line 126

Open in your IDE?
  1. <?php
  2. namespace App\AppBundle\MainBundle\Entity;
  3. use DateTime;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use JsonSerializable;
  8. use Symfony\Component\Validator\Constraints as Assert;
  9. /**
  10.  * AddOns
  11.  *
  12.  * @ORM\Entity
  13.  * @ORM\Table(name="orders_suppliers_transfers_status")
  14.  * @ORM\HasLifecycleCallbacks()
  15.  */
  16. class Orders_Suppliers_Transfers_Status implements JsonSerializable
  17. {
  18.     /**
  19.      * @ORM\Column(type="integer")
  20.      * @ORM\Id
  21.      * @ORM\GeneratedValue(strategy="AUTO")
  22.      */
  23.     private $id;
  24.     /**
  25.      * @var Orders_Suppliers_Transfer
  26.      * @ORM\ManyToOne(targetEntity="Orders_Suppliers_Transfer", inversedBy="order_supplier_transfers_status")
  27.      * @ORM\JoinColumn(name="order_supplier_transfer_id", referencedColumnName="id")
  28.      */
  29.     private $order_supplier_transfer;
  30.     /**
  31.      * @ORM\Column(type="string", nullable=true)
  32.      * @Assert\NotBlank()
  33.      */
  34.     private $comment;
  35.     /**
  36.      * @ORM\Column(type="string", nullable=true)
  37.      * @Assert\NotBlank()
  38.      */
  39.     private $status;//BookingStatus Constants for Refund Status
  40.     /**
  41.      * @return mixed
  42.      */
  43.     public function getId()
  44.     {
  45.         return $this->id;
  46.     }
  47.     /**
  48.      * @return Orders_Suppliers_Transfer
  49.      */
  50.     public function getOrderSupplierTransfer()
  51.     {
  52.         return $this->order_supplier_transfer;
  53.     }
  54.     /**
  55.      * @param Orders_Suppliers_Transfer $order_supplier_transfer
  56.      */
  57.     public function setOrderSupplierTransfer(Orders_Suppliers_Transfer $order_supplier_transfer)
  58.     {
  59.         $this->order_supplier_transfer $order_supplier_transfer;
  60.     }
  61.     /**
  62.      * @return mixed
  63.      */
  64.     public function getComment()
  65.     {
  66.         return $this->comment;
  67.     }
  68.     /**
  69.      * @param mixed $comment
  70.      */
  71.     public function setComment($comment)
  72.     {
  73.         $this->comment $comment;
  74.     }
  75.     /**
  76.      * @return mixed
  77.      */
  78.     public function getStatus()
  79.     {
  80.         return $this->status;
  81.     }
  82.     /**
  83.      * @param mixed $status
  84.      */
  85.     public function setStatus($status)
  86.     {
  87.         $this->status $status;
  88.     }
  89.     public function jsonSerialize()
  90.     {
  91.         return array(
  92.             'id' => $this->id,
  93.             'order_supplier_transfer_id' => $this->order_supplier_transfer->getId(),
  94.             'comment' => $this->comment,
  95.             'status' => $this->status,
  96.             'created' => $this->createdAt->format('Y-m-d H:i:s'),
  97.             'updated' => $this->updatedAt->format('Y-m-d H:i:s'),
  98.         );
  99.     }
  100.     /**
  101.      * @var DateTime $created
  102.      *
  103.      * @ORM\Column(type="datetime", nullable=false)
  104.      */
  105.     protected $createdAt;
  106.     /**
  107.      * @var DateTime $updated
  108.      *
  109.      * @ORM\Column(type="datetime", nullable=false)
  110.      */
  111.     protected $updatedAt;
  112.     /**
  113.      * @return DateTime
  114.      */
  115.     public function getCreatedAt()
  116.     {
  117.         return $this->createdAt;
  118.     }
  119.     /**
  120.      * @return DateTime
  121.      */
  122.     public function getUpdatedAt()
  123.     {
  124.         return $this->updatedAt;
  125.     }
  126.     public function setUpdatedAt($updatedAt)
  127.     {
  128.         $this->updatedAt $updatedAt;
  129.         return $this;
  130.     }
  131.     /**
  132.      * @ORM\PrePersist
  133.      */
  134.     public function setCreatedAt()
  135.     {
  136.         $this->createdAt = new DateTime();
  137.         $this->updatedAt = new DateTime();
  138.         return $this;
  139.     }
  140.     /**
  141.      * @ORM\PreUpdate
  142.      */
  143.     public function setUpdatedAtValue() {
  144.         $this->updatedAt = new DateTime();
  145.     }
  146.     public function __construct() {
  147.     }
  148. }