Exakat\Analyzer\Docs::getThemeAnalyzers PHP Method

getThemeAnalyzers() public method

public getThemeAnalyzers ( $theme = null )
    public function getThemeAnalyzers($theme = null)
    {
        if (is_array($theme)) {
            $theme = array_map(function ($x) {
                return trim($x, '"');
            }, $theme);
            $where = 'WHERE c.name in ("' . implode('", "', $theme) . '")';
        } elseif ($theme === null) {
            // Default is ALL of them
            $where = '';
        } else {
            $where = 'WHERE c.name = "' . trim($theme, '"') . '"';
        }
        $query = <<<SQL
        SELECT DISTINCT a.folder, a.name FROM analyzers AS a
    JOIN analyzers_categories AS ac
        ON ac.id_analyzer = a.id
    JOIN categories AS c
        ON c.id = ac.id_categories
    {$where}
SQL;
        $res = $this->sqlite->query($query);
        $return = array();
        while ($row = $res->fetchArray()) {
            $return[] = $row['folder'] . '/' . $row['name'];
        }
        return $return;
    }