43 lines
883 B
PHP
43 lines
883 B
PHP
<?php
|
|
|
|
namespace lib\Models;
|
|
|
|
use lib\Entities\HistoryEntity as Entity;
|
|
|
|
class HistoryModel extends CommonModel
|
|
{
|
|
const TABLE = "historydb";
|
|
const PK = "history_num";
|
|
const TITLE = "behavior";
|
|
public function __construct()
|
|
{
|
|
parent::__construct();
|
|
} //
|
|
|
|
final public function getTable(): string
|
|
{
|
|
return self::TABLE;
|
|
}
|
|
final public function getPKField(): string
|
|
{
|
|
return self::PK;
|
|
}
|
|
final public function getTitleField(): string
|
|
{
|
|
return self::TITLE;
|
|
}
|
|
|
|
final public function getEntity(): Entity
|
|
{
|
|
return new Entity($this->getResult());
|
|
} //
|
|
final public function getEntitys(): array
|
|
{
|
|
$entitys = [];
|
|
foreach ($this->getResults() as $result) {
|
|
$entitys[] = new Entity($result);
|
|
}
|
|
return $entitys;
|
|
} //
|
|
} //Class
|