Merge branch '120-add-comment-field-to-rider-rating-2' into 'master'
Resolve "Add comment field to rider rating" Closes #120 See merge request jankstudio/resq!107
This commit is contained in:
commit
6d38522125
2 changed files with 23 additions and 0 deletions
|
|
@ -1225,6 +1225,11 @@ class APIController extends Controller
|
||||||
->setJobOrder($jo)
|
->setJobOrder($jo)
|
||||||
->setRating($rating_num);
|
->setRating($rating_num);
|
||||||
|
|
||||||
|
// rider rating comment
|
||||||
|
$comment = $req->request->get('comment');
|
||||||
|
if (!empty($comment))
|
||||||
|
$rating->setComment($comment);
|
||||||
|
|
||||||
$em->persist($rating);
|
$em->persist($rating);
|
||||||
$em->flush();
|
$em->flush();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -52,10 +52,17 @@ class RiderRating
|
||||||
*/
|
*/
|
||||||
protected $rating;
|
protected $rating;
|
||||||
|
|
||||||
|
// customer's comment that goes along with the rating
|
||||||
|
/**
|
||||||
|
* @ORM\Column(type="text")
|
||||||
|
*/
|
||||||
|
protected $comment;
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->date_create = new DateTime();
|
$this->date_create = new DateTime();
|
||||||
$this->rating = 0;
|
$this->rating = 0;
|
||||||
|
$this->comment = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getID()
|
public function getID()
|
||||||
|
|
@ -111,4 +118,15 @@ class RiderRating
|
||||||
{
|
{
|
||||||
return $this->rating;
|
return $this->rating;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function setComment($comment)
|
||||||
|
{
|
||||||
|
$this->comment = $comment;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getComment()
|
||||||
|
{
|
||||||
|
return $this->comment;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue