_session = \Config\Services::session(); } abstract public function getAuthButton(); abstract public function execute(): UserEntity; final protected function getUserModel(): UserModel { if (is_null($this->_userModel)) { $this->_userModel = new UserModel(); } return $this->_userModel; } final protected function getUserSNSModel(): SNSUSerModel { if (is_null($this->_snsUserModel)) { $this->_snsUserModel = new SNSUserModel(); } return $this->_snsUserModel; } protected function setSession_process(UserEntity $entity): UserEntity { $this->_session->set(SESSION_NAMES['ISLOGIN'], true); $auths = []; foreach (array_values(AUTH_FIELDS) as $field) { switch ($field) { case 'id': $auths[$field] = $entity->getPK(); break; case 'title': $auths[$field] = $entity->getTitle(); break; case 'role': $auths[$field] = $entity->$field; break; } } $this->_session->set(SESSION_NAMES['AUTH'], $auths); return $entity; } }