Example #1
0
 public function InitializeContent()
 {
     $customId = getURLParam("custom", NULL);
     $this->title = CustomColumn::getAllTitle($customId);
     $this->entryArray = CustomColumn::getAllCustoms($customId);
     $this->idPage = CustomColumn::getAllCustomsId($customId);
 }
Example #2
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;
    }
Example #3
0
File: book.php Project: ha-y/cops
 public static function getBooksByCustom($customId, $id, $n)
 {
     $query = str_format(self::SQL_BOOKS_BY_CUSTOM, "{0}", "{1}", CustomColumn::getTableLinkName($customId), CustomColumn::getTableLinkColumn($customId));
     return self::getEntryArray($query, array($id), $n);
 }
Example #4
0
 public function InitializeContent()
 {
     $customId = getURLParam("custom", NULL);
     $custom = CustomColumn::createCustom($customId, $this->idGet);
     $this->idPage = $custom->getEntryId();
     $this->title = $custom->value;
     list($this->entryArray, $this->totalNumber) = Book::getBooksByCustom($custom, $this->idGet, $this->n);
 }