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

getByTag() public static method

Get all items by a given tag id
public static getByTag ( integer $tagId ) : array
$tagId integer
return array
    public static function getByTag($tagId)
    {
        $items = (array) BackendModel::getContainer()->get('database')->getRecords('SELECT i.id AS url, i.question AS name, mt.module
             FROM modules_tags AS mt
             INNER JOIN tags AS t ON mt.tag_id = t.id
             INNER JOIN faq_questions AS i ON mt.other_id = i.id
             WHERE mt.module = ? AND mt.tag_id = ? AND i.language = ?', array('Faq', (int) $tagId, BL::getWorkingLanguage()));
        foreach ($items as &$row) {
            $row['url'] = BackendModel::createURLForAction('Edit', 'Faq', null, array('id' => $row['url']));
        }
        return $items;
    }