Backend\Modules\Faq\Engine\Model::getAllFeedbackForQuestion PHP Method

getAllFeedbackForQuestion() public static method

Fetches all the feedback for a question
public static getAllFeedbackForQuestion ( integer $id ) : array
$id integer The question id.
return array
    public static function getAllFeedbackForQuestion($id)
    {
        return (array) BackendModel::getContainer()->get('database')->getRecords('SELECT f.*
             FROM faq_feedback AS f
             WHERE f.question_id = ? AND f.processed = ?', array((int) $id, 'N'));
    }

Usage Example

Example #1
0
 /**
  * Get the data
  */
 private function getData()
 {
     $this->record = (array) BackendFaqModel::get($this->id);
     $this->feedback = BackendFaqModel::getAllFeedbackForQuestion($this->id);
 }