<?php
namespace App\AppBundle\MainBundle\Entity;
use DateTime;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use JsonSerializable;
use Symfony\Component\Validator\Constraints as Assert;
/**
* AddOns
*
* @ORM\Entity
* @ORM\Table(name="orders_suppliers_transfers_status")
* @ORM\HasLifecycleCallbacks()
*/
class Orders_Suppliers_Transfers_Status implements JsonSerializable
{
/**
* @ORM\Column(type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @var Orders_Suppliers_Transfer
* @ORM\ManyToOne(targetEntity="Orders_Suppliers_Transfer", inversedBy="order_supplier_transfers_status")
* @ORM\JoinColumn(name="order_supplier_transfer_id", referencedColumnName="id")
*/
private $order_supplier_transfer;
/**
* @ORM\Column(type="string", nullable=true)
* @Assert\NotBlank()
*/
private $comment;
/**
* @ORM\Column(type="string", nullable=true)
* @Assert\NotBlank()
*/
private $status;//BookingStatus Constants for Refund Status
/**
* @return mixed
*/
public function getId()
{
return $this->id;
}
/**
* @return Orders_Suppliers_Transfer
*/
public function getOrderSupplierTransfer()
{
return $this->order_supplier_transfer;
}
/**
* @param Orders_Suppliers_Transfer $order_supplier_transfer
*/
public function setOrderSupplierTransfer(Orders_Suppliers_Transfer $order_supplier_transfer)
{
$this->order_supplier_transfer = $order_supplier_transfer;
}
/**
* @return mixed
*/
public function getComment()
{
return $this->comment;
}
/**
* @param mixed $comment
*/
public function setComment($comment)
{
$this->comment = $comment;
}
/**
* @return mixed
*/
public function getStatus()
{
return $this->status;
}
/**
* @param mixed $status
*/
public function setStatus($status)
{
$this->status = $status;
}
public function jsonSerialize()
{
return array(
'id' => $this->id,
'order_supplier_transfer_id' => $this->order_supplier_transfer->getId(),
'comment' => $this->comment,
'status' => $this->status,
'created' => $this->createdAt->format('Y-m-d H:i:s'),
'updated' => $this->updatedAt->format('Y-m-d H:i:s'),
);
}
/**
* @var DateTime $created
*
* @ORM\Column(type="datetime", nullable=false)
*/
protected $createdAt;
/**
* @var DateTime $updated
*
* @ORM\Column(type="datetime", nullable=false)
*/
protected $updatedAt;
/**
* @return DateTime
*/
public function getCreatedAt()
{
return $this->createdAt;
}
/**
* @return DateTime
*/
public function getUpdatedAt()
{
return $this->updatedAt;
}
public function setUpdatedAt($updatedAt)
{
$this->updatedAt = $updatedAt;
return $this;
}
/**
* @ORM\PrePersist
*/
public function setCreatedAt()
{
$this->createdAt = new DateTime();
$this->updatedAt = new DateTime();
return $this;
}
/**
* @ORM\PreUpdate
*/
public function setUpdatedAtValue() {
$this->updatedAt = new DateTime();
}
public function __construct() {
}
}