86 lines
1.6 KiB
PHP
86 lines
1.6 KiB
PHP
<?php
|
|
|
|
namespace App\Entity;
|
|
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
|
|
/**
|
|
* @ORM\Entity
|
|
* @ORM\Table(name="aggregated_rider_rating", indexes={
|
|
* @ORM\Index(name="rider_id_idx", columns={"rider_id"}),
|
|
* })
|
|
*/
|
|
class AggregatedRiderRating
|
|
{
|
|
// unique id
|
|
/**
|
|
* @ORM\Id
|
|
* @ORM\Column(type="integer")
|
|
* @ORM\GeneratedValue(strategy="AUTO")
|
|
*/
|
|
protected $id;
|
|
|
|
// rider id, loose association
|
|
/**
|
|
* @ORM\Column(type="integer", nullable=true)
|
|
*/
|
|
protected $rider_id;
|
|
|
|
// average rating of rider
|
|
/**
|
|
* @ORM\Column(type="float")
|
|
*/
|
|
protected $aggregate_rating;
|
|
|
|
// number of job orders
|
|
/**
|
|
* @ORM\Column(type="integer")
|
|
*/
|
|
protected $aggregate_count;
|
|
|
|
public function __construct()
|
|
{
|
|
$this->aggregate_rating = 0;
|
|
$this->aggregate_count = 0;
|
|
}
|
|
|
|
public function getID()
|
|
{
|
|
return $this->id;
|
|
}
|
|
|
|
public function setRiderId($rider_id)
|
|
{
|
|
$this->rider_id = $rider_id;
|
|
return $this;
|
|
}
|
|
|
|
public function getRiderId()
|
|
{
|
|
return $this->rider_id;
|
|
}
|
|
|
|
public function setAggregateRating($aggregate_rating)
|
|
{
|
|
$this->aggregate_rating = $aggregate_rating;
|
|
return $this;
|
|
}
|
|
|
|
public function getAggregateRating()
|
|
{
|
|
return $this->aggregate_rating;
|
|
}
|
|
|
|
public function setAggregateCount($aggregate_count)
|
|
{
|
|
$this->aggregate_count = $aggregate_count;
|
|
return $this;
|
|
}
|
|
|
|
public function getAggregateCount()
|
|
{
|
|
return $this->aggregate_count;
|
|
}
|
|
|
|
|
|
}
|