addClassPaths('Local'); } public function createDTO(array $formDatas): LocalDTO { return new LocalDTO($formDatas); } public function getDTOClass(): string { return LocalDTO::class; } public function getFormService(): LocalForm { if ($this->_form === null) { $this->_form = new LocalForm(); $this->_form->setAttributes([ 'pk_field' => $this->getPKField(), 'title_field' => $this->getTitleField(), 'table' => $this->model->getTable(), 'useAutoIncrement' => $this->model->useAutoIncrement(), 'class_path' => $this->getClassPaths(false), ]); } return $this->_form; } protected function getEntity_process(mixed $entity): UserEntity { return $entity; } protected function login_process(array $formDatas): UserEntity { $this->getFormService()->action_init_process('login', $formDatas); //입력값 검증 $this->getFormService()->validate($formDatas); //로그인 정보확인 $entity = $this->getEntity(['id' => $formDatas['id'], 'status' => 'AVAILABLE']); if (!$entity instanceof UserEntity) { throw new RuntimeException(static::class . '->' . __FUNCTION__ . "에서 {$formDatas['id']}에 대한 로그인 정보를 찾을수 없습니다."); } if (!password_verify($formDatas['passwd'], $entity->getPassword())) { throw new RuntimeException(static::class . '->' . __FUNCTION__ . "에서 암호가 맞지 않습니다."); } return $entity; } }