<?php
/**
* Created by PhpStorm.
* User: apple
* Date: 29/03/19
* Time: 3:08 PM
*/
namespace App\AppBundle\MainBundle\Entity;
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="ps_add_spot_availability")
* @ORM\HasLifecycleCallbacks()
*/
class PS_Add_Spot_Availability implements JsonSerializable
{
/**
* @ORM\Column(type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @ORM\Column(type="boolean", nullable=false)
* @Assert\NotBlank()
*/
private $is_24hour;
/**
* @ORM\Column(type="boolean", nullable=false)
* @Assert\NotBlank()
*/
private $is_active;
/**
* @ORM\ManyToOne(targetEntity="WP_Availability_Days")
* @ORM\JoinColumn(name="wp_availability_days_id", referencedColumnName="id")
*/
private $wp_availability_days;
/**
* Many features have one product. This is the owning side.
* @ORM\ManyToOne(targetEntity="PS_Add_Spot", inversedBy="ps_add_spot_availability")
* @ORM\JoinColumn(name="ps_add_spot_id", referencedColumnName="id")
*/
private $ps_add_spot;
/**
* @ORM\OneToMany(targetEntity="PS_Add_Spot_Availability_Custom", mappedBy="ps_add_spot_availability")
*/
private $ps_add_spot_availability_custom;
/**
* @ORM\Column(type="time", nullable=false)
* @Assert\NotBlank()
*/
private $start_time;
/**
* @ORM\Column(type="time", nullable=false)
* @Assert\NotBlank()
*/
private $end_time;
/**
* @return mixed
*/
public function getId()
{
return $this->id;
}
/**
* @return mixed
*/
public function getIs24hour()
{
return $this->is_24hour;
}
/**
* @param mixed $is_24hour
*/
public function setIs24hour($is_24hour)
{
$this->is_24hour = $is_24hour;
}
/**
* @return mixed
*/
public function getisActive()
{
return $this->is_active;
}
/**
* @param mixed $is_active
*/
public function setIsActive($is_active)
{
$this->is_active = $is_active;
}
/**
* @return WP_Availability_Days
*/
public function getWpAvailabilityDays()
{
return $this->wp_availability_days;
}
/**
* @param mixed $wp_availability_days
*/
public function setWpAvailabilityDays($wp_availability_days)
{
$this->wp_availability_days = $wp_availability_days;
}
/**
* @return mixed
*/
public function getPsAddSpotAvailabilityCustom()
{
return $this->ps_add_spot_availability_custom;
}
/**
* @param mixed $ps_add_spot_availability_custom
*/
public function setPsAddSpotAvailabilityCustom($ps_add_spot_availability_custom)
{
$this->ps_add_spot_availability_custom = $ps_add_spot_availability_custom;
}
/**
* @return mixed
*/
public function getPsAddSpot()
{
return $this->ps_add_spot;
}
/**
* @param mixed $ps_add_spot
*/
public function setPsAddSpot($ps_add_spot)
{
$this->ps_add_spot = $ps_add_spot;
}
/**
* @return mixed
*/
public function getStartTime()
{
return $this->start_time;
}
/**
* @param mixed $start_time
*/
public function setStartTime($start_time)
{
$this->start_time = $start_time;
}
/**
* @return mixed
*/
public function getEndTime()
{
return $this->end_time;
}
/**
* @param mixed $end_time
*/
public function setEndTime($end_time)
{
$this->end_time = $end_time;
}
public function jsonSerialize()
{
return array(
'id' => $this->id,
);
}
/**
* @var string $created
*
* @ORM\Column(name="created_at", type="string", nullable=false)
*/
protected $createdAt;
/**
* @var string $updated
*
* @ORM\Column(name="updated_at", type="string", nullable=false)
*/
protected $updatedAt;
public function getCreatedAt()
{
return $this->createdAt;
}
public function setCreatedAt($createdAt)
{
$this->createdAt = $createdAt;
return $this;
}
public function getUpdatedAt()
{
return $this->updatedAt;
}
public function setUpdatedAt($updatedAt)
{
$this->updatedAt = $updatedAt;
return $this;
}
/**
* @ORM\PrePersist
* @ORM\PreUpdate
*/
public function updatedTimestamps()
{
$this->setUpdatedAt(round(microtime(true) * 1000));
if ($this->getCreatedAt() === null) {
$this->setCreatedAt(round(microtime(true) * 1000));
}
}
public function __construct() {
$this->ps_add_spot_availability_custom = new ArrayCollection();
$this->setCreatedAt(round(microtime(true) * 1000));
}
}