_site = $site; $this->_debug = $debug; $this->_session = \Config\Services::session(); } final public function getSiteName(): string { if (is_null($this->_site)) { throw new \Exception("Auth Adpater Site명이 정의 되지 않았습니다."); } return ucfirst($this->_site); } abstract public function getAuthButton(); abstract public function signup(array $formDatas): UserEntity; final protected function getUserModel(): UserModel { if (is_null($this->_userModel)) { $this->_userModel = new UserModel(); } return $this->_userModel; } final protected function getUserSNSModel(): UserSNSModel { if (is_null($this->_userSNSModel)) { $this->_userSNSModel = new UserSNSModel(); } return $this->_userSNSModel; } protected function signup_process(UserEntity $entity): void { $this->_session->set(SESSION_NAMES['ISLOGIN'], true); $auths = []; foreach (AUTH_FIELDS as $key => $field) { switch ($field) { case 'id': $auths[$field] = $entity->getPrimaryKey(); break; case 'title': $auths[$field] = $entity->getTitle(); break; case 'role': $auths[$field] = $entity->getRole(); break; } } $this->_session->set(SESSION_NAMES['AUTH'], $auths); } }