<?php
namespace App\AppBundle\MainBundle\Entity;
use DateTime;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
use JsonSerializable;
/**
* AddOns
*
* @ORM\Entity
* @ORM\Table(name="order_flexible_detail")
* @ORM\HasLifecycleCallbacks()
*/
class Order_Flexible_Detail implements JsonSerializable
{
/**
* @ORM\Column(type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @var Orders
* @ORM\OneToOne(targetEntity="Orders", inversedBy="orderFlexibleDetail")
* @ORM\JoinColumn(name="order_id", referencedColumnName="id")
*/
private $order;
/**
* @var DateTime
* @ORM\Column(type="date", nullable=false)
* @Assert\NotBlank()
*/
private $start_date;
/**
* @var DateTime
* @ORM\Column(type="date", nullable=false)
* @Assert\NotBlank()
*/
private $end_date;
/**
* @var DateTime
* @ORM\Column(type="time", nullable=false)
* @Assert\NotBlank()
*/
private $start_time;
/**
* @var DateTime
* @ORM\Column(type="time", nullable=false)
* @Assert\NotBlank()
*/
private $end_time;
/**
* @var boolean
* @ORM\Column(type="boolean", nullable=true, options={"default" : 0})
* @Assert\NotBlank()
*/
private $isAllDays;
/**
* @var boolean
* @ORM\Column(type="boolean", nullable=true, options={"default" : 0})
* @Assert\NotBlank()
*/
private $is24Hours;
/**
* @var boolean
* @ORM\Column(type="boolean", nullable=true, options={"default" : 0})
* @Assert\NotBlank()
*/
private $isMonday;
/**
* @var boolean
* @ORM\Column(type="boolean", nullable=true, options={"default" : 0})
* @Assert\NotBlank()
*/
private $isTuesday;
/**
* @var boolean
* @ORM\Column(type="boolean", nullable=true, options={"default" : 0})
* @Assert\NotBlank()
*/
private $isWednesday;
/**
* @var boolean
* @ORM\Column(type="boolean", nullable=true, options={"default" : 0})
* @Assert\NotBlank()
*/
private $isThursday;
/**
* @ORM\Column(type="boolean", nullable=true, options={"default" : 0})
* @Assert\NotBlank()
*/
private $isFriday;
/**
* @var boolean
* @ORM\Column(type="boolean", nullable=true, options={"default" : 0})
* @Assert\NotBlank()
*/
private $isSaturday;
/**
* @var boolean
* @ORM\Column(type="boolean", nullable=true, options={"default" : 0})
* @Assert\NotBlank()
*/
private $isSunday;
/**
* @var integer
* @ORM\Column(type="integer", nullable=true)
* @Assert\NotBlank()
*/
private $totalDuration;
/**
* @return mixed
*/
public function getId()
{
return $this->id;
}
/**
* @return Orders
*/
public function getOrder()
{
return $this->order;
}
/**
* @param mixed $order
*/
public function setOrder($order)
{
$this->order = $order;
}
/**
* @return DateTime
*/
public function getStartDate()
{
return $this->start_date;
}
/**
* @param mixed $start_date
*/
public function setStartDate($start_date)
{
$this->start_date = $start_date;
}
/**
* @return DateTime
*/
public function getEndDate()
{
return $this->end_date;
}
/**
* @param mixed $end_date
*/
public function setEndDate($end_date)
{
$this->end_date = $end_date;
}
/**
* @return DateTime
*/
public function getStartTime()
{
return $this->start_time;
}
/**
* @param DateTime $start_time
*/
public function setStartTime(DateTime $start_time)
{
$this->start_time = $start_time;
}
/**
* @return DateTime
*/
public function getEndTime()
{
return $this->end_time;
}
/**
* @param DateTime $end_time
*/
public function setEndTime(DateTime $end_time)
{
$this->end_time = $end_time;
}
/**
* @return bool
*/
public function isAllDays()
{
return $this->isAllDays;
}
/**
* @param bool $isAllDays
*/
public function setIsAllDays(bool $isAllDays)
{
$this->isAllDays = $isAllDays;
}
/**
* @return bool
*/
public function isIs24Hours()
{
return $this->is24Hours;
}
/**
* @param bool $is24Hours
*/
public function setIs24Hours(bool $is24Hours)
{
$this->is24Hours = $is24Hours;
}
/**
* @return bool
*/
public function isMonday()
{
return $this->isMonday;
}
/**
* @param bool $isMonday
*/
public function setIsMonday(bool $isMonday)
{
$this->isMonday = $isMonday;
}
/**
* @return bool
*/
public function isTuesday()
{
return $this->isTuesday;
}
/**
* @param bool $isTuesday
*/
public function setIsTuesday(bool $isTuesday)
{
$this->isTuesday = $isTuesday;
}
/**
* @return bool
*/
public function isWednesday()
{
return $this->isWednesday;
}
/**
* @param bool $isWednesday
*/
public function setIsWednesday(bool $isWednesday)
{
$this->isWednesday = $isWednesday;
}
/**
* @return bool
*/
public function isThursday()
{
return $this->isThursday;
}
/**
* @param bool $isThursday
*/
public function setIsThursday(bool $isThursday)
{
$this->isThursday = $isThursday;
}
/**
* @return mixed
*/
public function getIsFriday()
{
return $this->isFriday;
}
/**
* @param mixed $isFriday
*/
public function setIsFriday($isFriday)
{
$this->isFriday = $isFriday;
}
/**
* @return bool
*/
public function isSaturday()
{
return $this->isSaturday;
}
/**
* @param bool $isSaturday
*/
public function setIsSaturday(bool $isSaturday)
{
$this->isSaturday = $isSaturday;
}
/**
* @return bool
*/
public function isSunday()
{
return $this->isSunday;
}
/**
* @param bool $isSunday
*/
public function setIsSunday(bool $isSunday)
{
$this->isSunday = $isSunday;
}
/**
* @return int
*/
public function getTotalDuration()
{
return $this->totalDuration;
}
/**
* @param int $totalDuration
*/
public function setTotalDuration(int $totalDuration)
{
$this->totalDuration = $totalDuration;
}
public function jsonSerialize()
{
return array(
'id' => $this->id,
'start_date' => $this->start_date->format('Y-m-d'),
'end_date' => $this->end_date->format('Y-m-d'),
'start_time' => $this->start_date->format('H:i:s'),
'end_time' => $this->end_date->format('H:i:s'),
'is24Hours' => $this->is24Hours,
'isAllDays' => $this->isAllDays,
'isMonday' => $this->isMonday,
'isTuesday' => $this->isTuesday,
'isWednesday' => $this->isWednesday,
'isThursday' => $this->isThursday,
'isFriday' => $this->isFriday,
'isSaturday' => $this->isSaturday,
'isSunday' => $this->isSunday,
'totalDuration' => $this->totalDuration,
'createdAt' => $this->createdAt->format('Y-m-d H:i:s'),
'updatedAt' => $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() {
}
}