public function all($pCond = null, $pFields = "*") { $all = parent::all($pCond, $pFields); foreach ($all as &$post) { $post['categories'] = Query::select('b.*', 'post_category a')->join('main_category b', Query::JOIN_INNER, 'a.id_category=b.id_category')->andWhere('a.id_post', Query::EQUAL, $post['id_post'])->execute(); } return $all; }
public function view() { if (!$this->actions->isEnabled('view')) { Go::to404(); } $this->setTitle($this->titles->get('view')); $data = $this->model->getTupleById($_GET["id"]); if (!$data) { Go::to404(); } $this->setTemplate("default", "view"); $this->addContent("data", $data); $this->addContent("h1", $this->h1->get('view')); }
public function deleteById($pId) { File::delete($this->getValueById("path_upload", $pId)); parent::deleteById($pId); }
public function __construct() { parent::__construct('sil_lists', 'id_list'); }
public function deleteById($pId) { Query::delete()->from('sil_user_links')->where('id_link', Query::EQUAL, $pId)->execute($this->handler); Query::delete()->from('sil_states')->where('id_link', Query::EQUAL, $pId)->execute($this->handler); return parent::deleteById($pId); }
public function __construct() { parent::__construct(sprintf(Configuration::$authentication_tableName, Core::$application), Configuration::$authentication_tableId); }
public function __construct() { parent::__construct('main_category', 'id_category'); }