src/AppBundle/MainBundle/Entity/User_Spot_Reviews.php line 315

Open in your IDE?
  1. <?php
  2. /**
  3.  * Created by PhpStorm.
  4.  * User: apple
  5.  * Date: 29/03/19
  6.  * Time: 3:08 PM
  7.  */
  8. namespace App\AppBundle\MainBundle\Entity;
  9. use Doctrine\ORM\Mapping as ORM;
  10. use Symfony\Component\Validator\Constraints as Assert;
  11. use JsonSerializable;
  12. /**
  13.  * AddOns
  14.  *
  15.  * @ORM\Entity
  16.  * @ORM\Table(name="user_spot_reviews")
  17.  * @ORM\HasLifecycleCallbacks()
  18.  */
  19. class User_Spot_Reviews implements JsonSerializable
  20. {
  21.     /**
  22.      * @ORM\Column(type="integer")
  23.      * @ORM\Id
  24.      * @ORM\GeneratedValue(strategy="AUTO")
  25.      */
  26.     private $id;
  27.     /**
  28.      * Many Token have one user. This is the owning side.
  29.      * @ORM\ManyToOne(targetEntity="PS_Add_Spot", inversedBy="user_spot_reviews")
  30.      * @ORM\JoinColumn(name="ps_add_spot_id", referencedColumnName="id")
  31.      */
  32.     private $ps_add_spot;
  33.     /**
  34.      * Many Token have one user. This is the owning side.
  35.      * @ORM\ManyToOne(targetEntity="User", inversedBy="user_spot_reviews")
  36.      * @ORM\JoinColumn(name="user_id", referencedColumnName="id")
  37.      */
  38.     private $user;//This will be spot provider
  39.     /**
  40.      * One Cart has One Customer.
  41.      * @ORM\OneToOne(targetEntity="Orders", inversedBy="user_spot_reviews")
  42.      * @ORM\JoinColumn(name="order_id", referencedColumnName="id")
  43.      */
  44.     private $order;
  45.     /**
  46.      * @ORM\Column(type="decimal", precision=2, scale=1, nullable=true)
  47.      * @Assert\NotBlank()
  48.      */
  49.     private $overall_rating;
  50.     /**
  51.      * @ORM\Column(type="decimal", precision=2, scale=1, nullable=true)
  52.      * @Assert\NotBlank()
  53.      */
  54.     private $overall_rating_wise_location_amenities;
  55.     /**
  56.      * @ORM\Column(type="decimal", precision=2, scale=1, nullable=true)
  57.      * @Assert\NotBlank()
  58.      */
  59.     private $overall_rating_wise_accessibility;
  60.     /**
  61.      * @ORM\Column(type="decimal", precision=2, scale=1, nullable=true)
  62.      * @Assert\NotBlank()
  63.      */
  64.     private $overall_rating_wise_value_for_money;
  65.     /**
  66.      * @ORM\Column(type="boolean", nullable=true, options={"default" : 0})
  67.      * @Assert\NotBlank()
  68.      */
  69.     private $is_rated;
  70.     /**
  71.      * @ORM\Column(type="boolean", nullable=true, options={"default" : 1})
  72.      * @Assert\NotBlank()
  73.      */
  74.     private $is_active;
  75.     /**
  76.      * @ORM\Column(type="datetime", nullable=true)
  77.      * @Assert\NotBlank()
  78.      */
  79.     private $rating_date;
  80.     /**
  81.      * @ORM\Column(type="datetime", nullable=true)
  82.      */
  83.     private $last_notified_date;
  84.     /**
  85.      * @return mixed
  86.      */
  87.     public function getId()
  88.     {
  89.         return $this->id;
  90.     }
  91.     /**
  92.      * @return PS_Add_Spot
  93.      */
  94.     public function getPsAddSpot()
  95.     {
  96.         return $this->ps_add_spot;
  97.     }
  98.     /**
  99.      * @param mixed $ps_add_spot
  100.      */
  101.     public function setPsAddSpot($ps_add_spot)
  102.     {
  103.         $this->ps_add_spot $ps_add_spot;
  104.     }
  105.     /**
  106.      * @return mixed
  107.      */
  108.     public function getIsRated()
  109.     {
  110.         return $this->is_rated;
  111.     }
  112.     /**
  113.      * @param mixed $is_rated
  114.      */
  115.     public function setIsRated($is_rated)
  116.     {
  117.         $this->is_rated $is_rated;
  118.     }
  119.     /**
  120.      * @return mixed
  121.      */
  122.     public function getRatingDate()
  123.     {
  124.         return $this->rating_date;
  125.     }
  126.     /**
  127.      * @param mixed $rating_date
  128.      */
  129.     public function setRatingDate($rating_date)
  130.     {
  131.         $this->rating_date $rating_date;
  132.     }
  133.     /**
  134.      * @return User
  135.      */
  136.     public function getUser()
  137.     {
  138.         return $this->user;
  139.     }
  140.     /**
  141.      * @param mixed $user
  142.      */
  143.     public function setUser($user)
  144.     {
  145.         $this->user $user;
  146.     }
  147.     /**
  148.      * @return mixed
  149.      */
  150.     public function getOverallRating()
  151.     {
  152.         return $this->overall_rating;
  153.     }
  154.     /**
  155.      * @param mixed $overall_rating
  156.      */
  157.     public function setOverallRating($overall_rating)
  158.     {
  159.         $this->overall_rating $overall_rating;
  160.     }
  161.     /**
  162.      * @return mixed
  163.      */
  164.     public function getOverallRatingWiseLocationAmenities()
  165.     {
  166.         return $this->overall_rating_wise_location_amenities;
  167.     }
  168.     /**
  169.      * @param mixed $overall_rating_wise_location_amenities
  170.      */
  171.     public function setOverallRatingWiseLocationAmenities($overall_rating_wise_location_amenities)
  172.     {
  173.         $this->overall_rating_wise_location_amenities $overall_rating_wise_location_amenities;
  174.     }
  175.     /**
  176.      * @return mixed
  177.      */
  178.     public function getOverallRatingWiseAccessibility()
  179.     {
  180.         return $this->overall_rating_wise_accessibility;
  181.     }
  182.     /**
  183.      * @param mixed $overall_rating_wise_accessibility
  184.      */
  185.     public function setOverallRatingWiseAccessibility($overall_rating_wise_accessibility)
  186.     {
  187.         $this->overall_rating_wise_accessibility $overall_rating_wise_accessibility;
  188.     }
  189.     /**
  190.      * @return mixed
  191.      */
  192.     public function getOverallRatingWiseValueForMoney()
  193.     {
  194.         return $this->overall_rating_wise_value_for_money;
  195.     }
  196.     /**
  197.      * @param mixed $overall_rating_wise_value_for_money
  198.      */
  199.     public function setOverallRatingWiseValueForMoney($overall_rating_wise_value_for_money)
  200.     {
  201.         $this->overall_rating_wise_value_for_money $overall_rating_wise_value_for_money;
  202.     }
  203.     /**
  204.      * @return Orders
  205.      */
  206.     public function getOrder()
  207.     {
  208.         return $this->order;
  209.     }
  210.     /**
  211.      * @param mixed $order
  212.      */
  213.     public function setOrder($order)
  214.     {
  215.         $this->order $order;
  216.     }
  217.     /**
  218.      * @return mixed
  219.      */
  220.     public function getIsActive()
  221.     {
  222.         return $this->is_active;
  223.     }
  224.     /**
  225.      * @param mixed $is_active
  226.      */
  227.     public function setIsActive($is_active)
  228.     {
  229.         $this->is_active $is_active;
  230.     }
  231.     /**
  232.      * @return \DateTime
  233.      */
  234.     public function getLastNotifiedDate()
  235.     {
  236.         return $this->last_notified_date;
  237.     }
  238.     /**
  239.      * @param mixed $last_notified_date
  240.      */
  241.     public function setLastNotifiedDate($last_notified_date)
  242.     {
  243.         $this->last_notified_date $last_notified_date;
  244.     }
  245.     public function jsonSerialize()
  246.     {
  247.         return array(
  248.             'id' => $this->id,
  249.         );
  250.     }
  251.     /**
  252.      * @var string $created
  253.      *
  254.      * @ORM\Column(name="created_at", type="string", nullable=false)
  255.      */
  256.     protected $createdAt;
  257.     /**
  258.      * @var string $updated
  259.      *
  260.      * @ORM\Column(name="updated_at", type="string", nullable=false)
  261.      */
  262.     protected $updatedAt;
  263.     public function getCreatedAt()
  264.     {
  265.         return $this->createdAt;
  266.     }
  267.     public function setCreatedAt($createdAt)
  268.     {
  269.         $this->createdAt $createdAt;
  270.         return $this;
  271.     }
  272.     public function getUpdatedAt()
  273.     {
  274.         return $this->updatedAt;
  275.     }
  276.     public function setUpdatedAt($updatedAt)
  277.     {
  278.         $this->updatedAt $updatedAt;
  279.         return $this;
  280.     }
  281.     /**
  282.      * @ORM\PrePersist
  283.      * @ORM\PreUpdate
  284.      */
  285.     public function updatedTimestamps()
  286.     {
  287.         $this->setUpdatedAt(round(microtime(true) * 1000));
  288.         if ($this->getCreatedAt() === null) {
  289.             $this->setCreatedAt(round(microtime(true) * 1000));
  290.         }
  291.     }
  292.     public function __construct() {
  293.         $this->setCreatedAt(round(microtime(true) * 1000));
  294.     }
  295. }