'if_exist|numeric', 'customer' => 'if_exist|string', 'id' => 'if_exist|string', 'passwd' => 'if_exist|string', 'ip' => 'if_exist|string', 'port' => 'if_exist|numeric', 'model' => 'if_exist|string', 'processor' => 'if_exist|string', 'memory' => 'if_exist|numeric', 'health' => 'if_exist|string', 'power' => 'if_exist|string', 'detail' => 'if_exist|string', 'status' => 'if_exist|in_list[use,unuse]', 'updated_at' => 'if_exist|valid_date', 'created_at' => 'if_exist|valid_date', ]; public function getEntityByField($field, $value): ?HPILOEntity { return $this->asObject(HPILOEntity::class)->where($field, $value)->first(); } public function getEntity($uid): ?HPILOEntity { return $this->getEntityByField($this->primaryKey, $uid); } public function getFieldFormOptions(array $wheres = array(), $temps = array()): array { foreach ($this->asObject(HPILOEntity::class)->where($wheres)->findAll() as $entity) { $temps[$entity->getPrimaryKey()] = $entity->getTitle(); } return $temps; } public function create(array $datas): HPILOEntity { return $this->create_process(new HPILOEntity($datas)); } public function modify(HPILOEntity $entity, array $datas): HPILOEntity { foreach ($datas as $field => $value) { if ($entity->$field != $datas[$field]) { $entity->$field = $value; } } return $this->modify_process($entity); } //Index관련 public function setIndexWordFilter(string $word) { parent::setIndexWordFilter($word); $this->orLike('customer', $word, 'both'); } public function setIndexOrderBy($field, $order = 'ASC') { $this->orderBy("health", "ASC"); parent::setIndexOrderBy($field, $order); } }