43 lines
867 B
PHP
43 lines
867 B
PHP
<?php
|
|
|
|
namespace lib\Models;
|
|
|
|
use lib\Entities\VPCEntity as Entity;
|
|
|
|
class VPCModel extends CommonModel
|
|
{
|
|
const TABLE = "vpcdb";
|
|
const PK = "vpc_num";
|
|
const TITLE = "vpc_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
|