public static function getByTag($tagId)
{
// redefine
$tagId = (int) $tagId;
// get the items
$items = (array) BackendModel::getContainer()->get('database')->getRecords('SELECT i.id AS url, i.title AS name, mt.module
FROM modules_tags AS mt
INNER JOIN tags AS t ON mt.tag_id = t.id
INNER JOIN pages AS i ON mt.other_id = i.id
WHERE mt.module = ? AND mt.tag_id = ? AND i.status = ?', array('pages', $tagId, 'active'));
// loop items
foreach ($items as &$row) {
$row['url'] = BackendModel::createURLForAction('Edit', 'Pages', null, array('id' => $row['url']));
}
// return
return $items;
}