kundius

getTagIDs

Jul 15th, 2017
1,489
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.31 KB | None | 0 0
  1. <?php
  2. $master = !empty($master)?$master:$modx->resource->id;
  3.  
  4. $tq = $modx->newQuery('TaggerTagResource');
  5. $tq->select('tag');
  6. $tq->where(array(
  7.     'resource' => $master
  8. ));
  9. $tq->groupby('tag');
  10.  
  11. if ($tq->prepare() && $tq->stmt->execute()) {
  12.     return $tq->stmt->fetchAll(PDO::FETCH_COLUMN);
  13. }
  14.  
  15. return false;
Advertisement
Add Comment
Please, Sign In to add comment