c
This commit is contained in:
21
inc/Hura8/Components/Page/Model/PageLanguageModel.php
Normal file
21
inc/Hura8/Components/Page/Model/PageLanguageModel.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace Hura8\Components\Page\Model;
|
||||
|
||||
use Hura8\System\Model\EntityLanguageModel;
|
||||
use Hura8\Interfaces\EntityType;
|
||||
|
||||
class PageLanguageModel extends EntityLanguageModel
|
||||
{
|
||||
|
||||
protected $richtext_fields = [
|
||||
'content',
|
||||
'content_html',
|
||||
];
|
||||
|
||||
public function __construct() {
|
||||
parent::__construct(EntityType::PAGE, '', $this->richtext_fields);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
76
inc/Hura8/Components/Page/Model/PageModel.php
Normal file
76
inc/Hura8/Components/Page/Model/PageModel.php
Normal file
@@ -0,0 +1,76 @@
|
||||
<?php
|
||||
|
||||
namespace Hura8\Components\Page\Model;
|
||||
|
||||
use Hura8\Interfaces\AppResponse;
|
||||
use Hura8\Interfaces\iEntityModel;
|
||||
use Hura8\Interfaces\EntityType;
|
||||
use Hura8\System\Controller\UrlManagerController;
|
||||
use Hura8\System\Model\aEntityBaseModel;
|
||||
use Hura8\System\ModuleManager;
|
||||
|
||||
class PageModel extends aEntityBaseModel implements iEntityModel
|
||||
{
|
||||
|
||||
protected $richtext_fields = [
|
||||
'content',
|
||||
'content_html',
|
||||
];
|
||||
|
||||
protected $tb_page_info = "tb_page_info";
|
||||
|
||||
public function __construct() {
|
||||
parent::__construct(EntityType::PAGE, '', null, $this->richtext_fields);
|
||||
}
|
||||
|
||||
|
||||
protected function extendedFilterOptions() : array
|
||||
{
|
||||
return [
|
||||
// empty for now
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
public function getFullInfo($id) : ?array
|
||||
{
|
||||
$query = $this->db->runQuery(
|
||||
"SELECT * FROM `".$this->tb_entity."` basic, `".$this->tb_page_info."` info
|
||||
WHERE basic.`id` = info.`page_id` AND basic.id = ?
|
||||
LIMIT 1 ",
|
||||
['d'], [$id]
|
||||
);
|
||||
|
||||
if( $item_info = $this->db->fetchAssoc($query)){
|
||||
return $item_info;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
protected function _buildQueryConditionExtend(array $filter_condition): ?array
|
||||
{
|
||||
/*$condition = array(
|
||||
"q" => "",
|
||||
"status" => 0,
|
||||
);*/
|
||||
|
||||
/*$condition = array(
|
||||
"letter" => "",
|
||||
);*/
|
||||
|
||||
$catCondition = [];
|
||||
$bind_types = [];
|
||||
$bind_values = [];
|
||||
|
||||
/*if(isset($filter_condition["letter"]) && strlen($filter_condition["letter"]) == 1){
|
||||
$catCondition[] = " AND `letter` = ? ";
|
||||
$bind_types[] = 's';
|
||||
$bind_values[] = $filter_condition["letter"];
|
||||
}*/
|
||||
|
||||
return array( join(" ", $catCondition), $bind_types, $bind_values);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user