_site = $site; $this->_debug = $debug; } 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 signin(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 setSessionInfo(UserEntity $entity, array $authrizedDatas = array()): void { $authrizedDatas[LOGINS['ISLOGIN']] = true; $authrizedDatas['uid'] = $entity->getPrimaryKey(); $authrizedDatas['name'] = $entity->getTitle(); $authrizedDatas['email'] = $entity->email; $authrizedDatas['role'] = $entity->role; session()->set($authrizedDatas); } public function getSessionInfo(array $authrizedDatas = array()): array { $authrizedDatas[LOGINS['ISLOGIN']] = session()->get(LOGINS['ISLOGIN']); $authrizedDatas['uid'] = session()->get('uid'); $authrizedDatas['name'] = session()->get('name'); $authrizedDatas['email'] = session()->get('email'); $authrizedDatas['role'] = session()->get('role'); return $authrizedDatas; } }