43 lines
867 B
PHP
43 lines
867 B
PHP
<?php
|
|
|
|
namespace lib\Models;
|
|
|
|
use lib\Entities\KCSEntity as Entity;
|
|
|
|
class KCSModel extends CommonModel
|
|
{
|
|
const TABLE = "kcsdb";
|
|
const PK = "kcs_num";
|
|
const TITLE = "kcs_code";
|
|
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
|