<?php
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_my_spots")
* @ORM\HasLifecycleCallbacks()
*/
class PS_My_Spots implements JsonSerializable
{
/**
* @ORM\Column(type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* Many Token have one user. This is the owning side.
* @ORM\ManyToOne(targetEntity="User", inversedBy="add_spot")
* @ORM\JoinColumn(name="user_id", referencedColumnName="id")
*/
private $user;
/**
* One Product has One Shipment.
* @ORM\OneToOne(targetEntity="PS_Add_Spot")
* @ORM\JoinColumn(name="ps_add_spot_id", referencedColumnName="id")
*/
private $ps_add_spot;
/**
* @ORM\Column(type="boolean", nullable=true, options={"default" : 0})
* @Assert\NotBlank()
*/
private $is_active;
/**
* @return mixed
*/
public function getId()
{
return $this->id;
}
/**
* @return mixed
*/
public function getUser()
{
return $this->user;
}
/**
* @param mixed $user
*/
public function setUser($user)
{
$this->user = $user;
}
/**
* @return mixed
*/
public function getIsActive()
{
return $this->is_active;
}
/**
* @param mixed $is_active
*/
public function setIsActive($is_active)
{
$this->is_active = $is_active;
}
/**
* @return PS_Add_Spot
*/
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;
}
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->setCreatedAt(round(microtime(true) * 1000));
}
}