Add Custom columns through config. Only tested in HTML catalog for now

re #32
This commit is contained in:
Sébastien Lucas 2013-01-19 07:08:47 +01:00
parent a96888c76a
commit f4675dec52
5 changed files with 71 additions and 6 deletions

View file

@ -55,6 +55,15 @@ class CustomColumn extends Base {
$post = $result->fetchObject ();
return $post->name;
}
public static function getCustomId ($lookup) {
$result = parent::getDb ()->prepare('select id from custom_columns where label = ?');
$result->execute (array ($lookup));
if ($post = $result->fetchObject ()) {
return $post->id;
}
return NULL;
}
public static function getCount($customId) {
$nCustoms = parent::getDb ()->query('select count(*) from ' . self::getTableName ($customId))->fetchColumn();