<?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="user_spot_reviews")
* @ORM\HasLifecycleCallbacks()
*/
class User_Spot_Reviews 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="PS_Add_Spot", inversedBy="user_spot_reviews")
* @ORM\JoinColumn(name="ps_add_spot_id", referencedColumnName="id")
*/
private $ps_add_spot;
/**
* Many Token have one user. This is the owning side.
* @ORM\ManyToOne(targetEntity="User", inversedBy="user_spot_reviews")
* @ORM\JoinColumn(name="user_id", referencedColumnName="id")
*/
private $user;//This will be spot provider
/**
* One Cart has One Customer.
* @ORM\OneToOne(targetEntity="Orders", inversedBy="user_spot_reviews")
* @ORM\JoinColumn(name="order_id", referencedColumnName="id")
*/
private $order;
/**
* @ORM\Column(type="decimal", precision=2, scale=1, nullable=true)
* @Assert\NotBlank()
*/
private $overall_rating;
/**
* @ORM\Column(type="decimal", precision=2, scale=1, nullable=true)
* @Assert\NotBlank()
*/
private $overall_rating_wise_location_amenities;
/**
* @ORM\Column(type="decimal", precision=2, scale=1, nullable=true)
* @Assert\NotBlank()
*/
private $overall_rating_wise_accessibility;
/**
* @ORM\Column(type="decimal", precision=2, scale=1, nullable=true)
* @Assert\NotBlank()
*/
private $overall_rating_wise_value_for_money;
/**
* @ORM\Column(type="boolean", nullable=true, options={"default" : 0})
* @Assert\NotBlank()
*/
private $is_rated;
/**
* @ORM\Column(type="boolean", nullable=true, options={"default" : 1})
* @Assert\NotBlank()
*/
private $is_active;
/**
* @ORM\Column(type="datetime", nullable=true)
* @Assert\NotBlank()
*/
private $rating_date;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $last_notified_date;
/**
* @return mixed
*/
public function getId()
{
return $this->id;
}
/**
* @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;
}
/**
* @return mixed
*/
public function getIsRated()
{
return $this->is_rated;
}
/**
* @param mixed $is_rated
*/
public function setIsRated($is_rated)
{
$this->is_rated = $is_rated;
}
/**
* @return mixed
*/
public function getRatingDate()
{
return $this->rating_date;
}
/**
* @param mixed $rating_date
*/
public function setRatingDate($rating_date)
{
$this->rating_date = $rating_date;
}
/**
* @return User
*/
public function getUser()
{
return $this->user;
}
/**
* @param mixed $user
*/
public function setUser($user)
{
$this->user = $user;
}
/**
* @return mixed
*/
public function getOverallRating()
{
return $this->overall_rating;
}
/**
* @param mixed $overall_rating
*/
public function setOverallRating($overall_rating)
{
$this->overall_rating = $overall_rating;
}
/**
* @return mixed
*/
public function getOverallRatingWiseLocationAmenities()
{
return $this->overall_rating_wise_location_amenities;
}
/**
* @param mixed $overall_rating_wise_location_amenities
*/
public function setOverallRatingWiseLocationAmenities($overall_rating_wise_location_amenities)
{
$this->overall_rating_wise_location_amenities = $overall_rating_wise_location_amenities;
}
/**
* @return mixed
*/
public function getOverallRatingWiseAccessibility()
{
return $this->overall_rating_wise_accessibility;
}
/**
* @param mixed $overall_rating_wise_accessibility
*/
public function setOverallRatingWiseAccessibility($overall_rating_wise_accessibility)
{
$this->overall_rating_wise_accessibility = $overall_rating_wise_accessibility;
}
/**
* @return mixed
*/
public function getOverallRatingWiseValueForMoney()
{
return $this->overall_rating_wise_value_for_money;
}
/**
* @param mixed $overall_rating_wise_value_for_money
*/
public function setOverallRatingWiseValueForMoney($overall_rating_wise_value_for_money)
{
$this->overall_rating_wise_value_for_money = $overall_rating_wise_value_for_money;
}
/**
* @return Orders
*/
public function getOrder()
{
return $this->order;
}
/**
* @param mixed $order
*/
public function setOrder($order)
{
$this->order = $order;
}
/**
* @return mixed
*/
public function getIsActive()
{
return $this->is_active;
}
/**
* @param mixed $is_active
*/
public function setIsActive($is_active)
{
$this->is_active = $is_active;
}
/**
* @return \DateTime
*/
public function getLastNotifiedDate()
{
return $this->last_notified_date;
}
/**
* @param mixed $last_notified_date
*/
public function setLastNotifiedDate($last_notified_date)
{
$this->last_notified_date = $last_notified_date;
}
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));
}
}