Model

Description

In the model, you can create methods that have database queries and are responsible for data processing. You have to remember to install dframe/database package before starting work. It's available on GITHUB or through the composer.

namespace Model;

class RequestModel extends \Model\Model
{

    /**
     * @param int $requestId
     * @return mixed
     */
    public function getRequestSettings($requestId)
    {
        $row = $this->baseClass->db->pdoQuery('SELECT * FROM `request_type` WHERE request_type_id = ?', [$requestId])->result();
        return $this->methodResult(true, $row);
    }
}

Notice that virtually all methods, except for a few, return the data in the form of a ready to read table and are returned by the method.

/**
  * @param boolean
  * @param array
  */
$this->methodResult(true, $row);
Edit page (Model/overview)