39 lines
863 B
PHP
39 lines
863 B
PHP
<?php
|
|
|
|
namespace App\Entities;
|
|
|
|
use CodeIgniter\Entity\Entity;
|
|
|
|
abstract class CommonEntity extends Entity
|
|
{
|
|
protected $datamap = [];
|
|
protected $dates = ['created_at', 'updated_at', 'deleted_at'];
|
|
protected $casts = [];
|
|
|
|
public function __construct(array|null $data = null)
|
|
{
|
|
parent::__construct($data);
|
|
}
|
|
|
|
abstract public function __toString();
|
|
final public function getPK(): string
|
|
{
|
|
$field = constant("static::PKField");
|
|
return $this->$field;
|
|
}
|
|
final public function getTitle(): string
|
|
{
|
|
$field = constant("static::TitleField");
|
|
return $this->$field;
|
|
}
|
|
final public function getUpdatedAt(): string
|
|
{
|
|
return $this->created_at;
|
|
}
|
|
final public function getCreatedAt(): string
|
|
{
|
|
return $this->created_at;
|
|
}
|
|
//공통부분
|
|
}
|