Bummer! This is just a preview. You need to be signed in with an account to view the entire instruction.

Well done!

You have completed Build a REST API with PHP!

Instruction

Review Class

<?php
namespace App\Model;
use \App\Exception\ApiException;

class Review
{
    protected $database;
    public function __construct(\PDO $database)
    {
        $this->database = $database;
    }
    public function getReviewsByCourseId($course_id)
    {
        if (empty($course_id)) {
            throw new ApiException(ApiException::INFO_REQUIRED);
        }
        $st...