resq/src/Entity/Review.php

141 lines
2.8 KiB
PHP

<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use DateTime;
/**
* @ORM\Entity
* @ORM\Table(name="review")
*/
class Review
{
// unique id
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
// partner being reviewed
/**
* @ORM\ManyToOne(targetEntity="Partner")
* @ORM\JoinColumn(name="partner_id", referencedColumnName="id")
*/
protected $partner;
// customer's rating of partner
/**
* @ORM\Column(type="integer")
*/
protected $rating;
// message that goes with the rating
/**
* @ORM\Column(type="text")
*/
protected $message;
// date created
/**
* @ORM\Column(type="datetime")
*/
protected $date_create;
// mobile session that sent review
/**
* @ORM\ManyToOne(targetEntity="MobileSession", inversedBy="reviews")
* @ORM\JoinColumn(name="mobile_session_id", referencedColumnName="id", nullable=true)
*/
protected $mobile_session;
// customer session (new) that sent review
/**
* @ORM\ManyToOne(targetEntity="CustomerSession", inversedBy="reviews")
* @ORM\JoinColumn(name="customer_session_id", referencedColumnName="id", nullable=true)
*/
protected $customer_session;
// customer user sent review
/**
* @ORM\ManyToOne(targetEntity="MobileSession", inversedBy="reviews")
* @ORM\JoinColumn(name="mobile_session_id", referencedColumnName="id")
*/
protected $customer;
public function __construct()
{
$this->date_create = new DateTime();
$this->rating = 0;
$this->message = "";
}
public function getID()
{
return $this->id;
}
public function setPartner(Partner $partner)
{
$this->partner = $partner;
return $this;
}
public function getPartner()
{
return $this->partner;
}
public function setRating($rating)
{
$this->rating = $rating;
return $this;
}
public function getRating()
{
return $this->rating;
}
public function setMessage($message)
{
$this->message = $message;
return $this;
}
public function getMessage()
{
return $this->message;
}
public function getDateCreate()
{
return $this->date_create;
}
public function setMobileSession(MobileSession $mobile_session)
{
$this->mobile_session = $mobile_session;
return $this;
}
public function getMobileSession()
{
return $this->mobile_session;
}
public function setCustomerSession(CustomerSession $customer_session)
{
$this->customer_session = $customer_session;
return $this;
}
public function getCustomerSession()
{
return $this->customer_session;
}
}