Example #1
0
/**
 * Fetch a query string from the stored queries file
 *
 * @param string $index Which index to replace
 * @param string $driver Which database driver
 * @param array $params Parameters to be replaced in the query string?
 * @return string
 * @throws NotImplementedException
 */
function queryStringRoot(string $index, string $driver = '', array $params = []) : string
{
    return \Airship\queryString($index, $params, '', $driver);
}
Example #2
0
 /**
  * List tags (paginated, sortable).
  *
  * @param int $offset
  * @param int $limit
  * @param string $sort
  * @param bool $desc
  * @return array
  */
 public function listTags(int $offset, int $limit, string $sort = 'name', bool $desc = false) : array
 {
     $orderBy = $this->orderBy($sort, $desc ? 'DESC' : 'ASC', ['name', 'created']);
     $tags = $this->db->safeQuery(\Airship\queryString('blog.tags.list_all', ['orderby' => $orderBy, 'offset' => $offset, 'limit' => $limit]));
     if (empty($tags)) {
         return [];
     }
     return $tags;
 }