<?php
/**
* Created by PhpStorm.
* User: apple
* Date: 29/03/19
* Time: 3:08 PM
*/
namespace App\AppBundle\MainBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
use JsonSerializable;
/**
* AddOns
*
* @ORM\Entity
* @ORM\Table(name="ps_add_spot_loc_detail_near_by")
* @ORM\HasLifecycleCallbacks()
*/
class PS_Add_Spot_Loc_Detail_Near_By implements JsonSerializable
{
/**
* @ORM\Column(type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* Many features have one product. This is the owning side.
* @ORM\ManyToOne(targetEntity="PS_Add_Spot_Loc_Detail", inversedBy="ps_add_spot_loc_detail_near_by")
* @ORM\JoinColumn(name="ps_add_spot_loc_detail_id", referencedColumnName="id")
*/
private $ps_add_spot_loc_detail;
/**
* @ORM\Column(type="string", nullable=false)
* @Assert\NotBlank()
*/
private $name;
/**
* @ORM\Column(type="integer", nullable=true)
* @Assert\NotBlank()
*/
private $distance;
/**
* @ORM\Column(type="string", nullable=true)
* @Assert\NotBlank()
*/
private $distance_text;
/**
* @ORM\Column(type="integer", nullable=true)
* @Assert\NotBlank()
*/
private $duration;
/**
* @ORM\Column(type="string", nullable=true)
* @Assert\NotBlank()
*/
private $duration_text;
/**
* @ORM\Column(type="decimal", precision=11, scale=8)
* @Assert\NotBlank()
*/
private $latitude;
/**
* @ORM\Column(type="decimal", precision=11, scale=8)
* @Assert\NotBlank()
*/
private $longitude;
/**
* @return mixed
*/
public function getId()
{
return $this->id;
}
/**
* @return mixed
*/
public function getPsAddSpotLocDetail()
{
return $this->ps_add_spot_loc_detail;
}
/**
* @param mixed $ps_add_spot_loc_detail
*/
public function setPsAddSpotLocDetail($ps_add_spot_loc_detail)
{
$this->ps_add_spot_loc_detail = $ps_add_spot_loc_detail;
}
/**
* @return mixed
*/
public function getName()
{
return $this->name;
}
/**
* @param mixed $name
*/
public function setName($name)
{
$this->name = $name;
}
/**
* @return mixed
*/
public function getDistance()
{
return $this->distance;
}
/**
* @param mixed $distance
*/
public function setDistance($distance)
{
$this->distance = $distance;
}
/**
* @return mixed
*/
public function getDistanceText()
{
return $this->distance_text;
}
/**
* @param mixed $distance_text
*/
public function setDistanceText($distance_text)
{
$this->distance_text = $distance_text;
}
/**
* @return mixed
*/
public function getDuration()
{
return $this->duration;
}
/**
* @param mixed $duration
*/
public function setDuration($duration)
{
$this->duration = $duration;
}
/**
* @return mixed
*/
public function getDurationText()
{
return $this->duration_text;
}
/**
* @param mixed $duration_text
*/
public function setDurationText($duration_text)
{
$this->duration_text = $duration_text;
}
/**
* @return mixed
*/
public function getLatitude()
{
return $this->latitude;
}
/**
* @param mixed $latitude
*/
public function setLatitude($latitude)
{
$this->latitude = $latitude;
}
/**
* @return mixed
*/
public function getLongitude()
{
return $this->longitude;
}
/**
* @param mixed $longitude
*/
public function setLongitude($longitude)
{
$this->longitude = $longitude;
}
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));
}
}