Automation init...1
This commit is contained in:
parent
630e213e3e
commit
fdab7f4307
@ -49,7 +49,6 @@ abstract class CommonModel extends Model
|
|||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
$this->setFields($fields);
|
$this->setFields($fields);
|
||||||
$this->setRules($this->getFields());
|
|
||||||
}
|
}
|
||||||
abstract public function getTitleField(): string;
|
abstract public function getTitleField(): string;
|
||||||
|
|
||||||
@ -69,6 +68,7 @@ abstract class CommonModel extends Model
|
|||||||
final public function setFields(array $fields): void
|
final public function setFields(array $fields): void
|
||||||
{
|
{
|
||||||
$this->allowedFields = $fields;
|
$this->allowedFields = $fields;
|
||||||
|
$this->setRules($this->allowedFields);
|
||||||
}
|
}
|
||||||
final public function getRules(array $options): array //options=>except or only
|
final public function getRules(array $options): array //options=>except or only
|
||||||
{
|
{
|
||||||
|
|||||||
@ -58,6 +58,7 @@ abstract class BoardModel extends CommonModel
|
|||||||
$entity = $this->create_process($entity);
|
$entity = $this->create_process($entity);
|
||||||
//GID값이 PK랑 같은 값 전달 후 Entity 수정
|
//GID값이 PK랑 같은 값 전달 후 Entity 수정
|
||||||
$entity->gid = $entity->getPK();
|
$entity->gid = $entity->getPK();
|
||||||
|
$this->setFields(["gid"]);
|
||||||
return $this->modify_process($entity);
|
return $this->modify_process($entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -61,6 +61,7 @@ class UserModel extends CommonModel
|
|||||||
$entity = $this->create_process($entity);
|
$entity = $this->create_process($entity);
|
||||||
//GID값이 PK랑 같은 값 전달 후 Entity 수정
|
//GID값이 PK랑 같은 값 전달 후 Entity 수정
|
||||||
$entity->gid = $entity->getPK();
|
$entity->gid = $entity->getPK();
|
||||||
|
$this->setFields(["gid"]);
|
||||||
return $this->modify_process($entity);
|
return $this->modify_process($entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user