Example #1
0
    public static function getAllCustoms($customId)
    {
        $result = parent::getDb()->query(str_format('select {0}.id as id, {0}.value as name, count(*) as count
from {0}, {1}
where {0}.id = {1}.{2}
group by {0}.id, {0}.value
order by {0}.value', self::getTableName($customId), self::getTableLinkName($customId), self::getTableLinkColumn($customId)));
        $entryArray = array();
        while ($post = $result->fetchObject()) {
            $customColumn = new CustomColumn($post->id, $post->name, $customId);
            array_push($entryArray, new Entry($customColumn->name, $customColumn->getEntryId(), str_format(localize("bookword", $post->count), $post->count), "text", array(new LinkNavigation($customColumn->getUri())), "", $post->count));
        }
        return $entryArray;
    }