original_string: public function doSettingService($action, $value = null)
      {
  
          $response = false;
          $this->extResponse = null;
          switch ($action) {
              case self::EXT_READ:
                  $do = 'basic-lti-loadsetting';
                  break;
              case self::EXT_WRITE:
                  $do = 'basic-lti-savesetting';
                  break;
              case self::EXT_DELETE:
                  $do = 'basic-lti-deletesetting';
                  break;
          }
          if (isset($do)) {
  
              $url = $this->getSetting('ext_ims_lti_tool_setting_url');
              $params = array();
              $params['id'] = $this->getSetting('ext_ims_lti_tool_setting_id');
              if (is_null($value)) {
                  $value = '';
              }
              $params['setting'] = $value;
  
              if ($this->doService($do, $url, $params)) {
                  switch ($action) {
                      case self::EXT_READ:
                          if (isset($this->extNodes['setting']['value'])) {
                              $response = $this->extNodes['setting']['value'];
                              if (is_array($response)) {
                                  $response = '';
                              }
                          }
                          break;
                      case self::EXT_WRITE:
                          $this->setSetting('ext_ims_lti_tool_setting', $value);
                          $this->saveSettings();
                          $response = true;
                          break;
                      case self::EXT_DELETE:
                          $response = true;
                          break;
                  }
              }
          }
  
          return $response;
  
      }
code: public function doSettingService($action, $value = null)
      {
  
          $response = false;
          $this->extResponse = null;
          switch ($action) {
              case self::EXT_READ:
                  $do = 'basic-lti-loadsetting';
                  break;
              case self::EXT_WRITE:
                  $do = 'basic-lti-savesetting';
                  break;
              case self::EXT_DELETE:
                  $do = 'basic-lti-deletesetting';
                  break;
          }
          if (isset($do)) {
  
              $url = $this->getSetting('ext_ims_lti_tool_setting_url');
              $params = array();
              $params['id'] = $this->getSetting('ext_ims_lti_tool_setting_id');
              if (is_null($value)) {
                  $value = '';
              }
              $params['setting'] = $value;
  
              if ($this->doService($do, $url, $params)) {
                  switch ($action) {
                      case self::EXT_READ:
                          if (isset($this->extNodes['setting']['value'])) {
                              $response = $this->extNodes['setting']['value'];
                              if (is_array($response)) {
                                  $response = '';
                              }
                          }
                          break;
                      case self::EXT_WRITE:
                          $this->setSetting('ext_ims_lti_tool_setting', $value);
                          $this->saveSettings();
                          $response = true;
                          break;
                      case self::EXT_DELETE:
                          $response = true;
                          break;
                  }
              }
          }
  
          return $response;
  
      }
code_tokens: public function doSettingService ( $ action , $ value = null ) { $ response = false ; $ this -> extResponse = null ; switch ( $ action ) { case self :: EXT_READ : $ do = 'basic-lti-loadsetting' ; break ; case self :: EXT_WRITE : $ do = 'basic-lti-savesetting' ; break ; case self :: EXT_DELETE : $ do = 'basic-lti-deletesetting' ; break ; } if ( isset ( $ do ) ) { $ url = $ this -> getSetting ( 'ext_ims_lti_tool_setting_url' ) ; $ params = array ( ) ; $ params [ 'id' ] = $ this -> getSetting ( 'ext_ims_lti_tool_setting_id' ) ; if ( is_null ( $ value ) ) { $ value = '' ; } $ params [ 'setting' ] = $ value ; if ( $ this -> doService ( $ do , $ url , $ params ) ) { switch ( $ action ) { case self :: EXT_READ : if ( isset ( $ this -> extNodes [ 'setting' ] [ 'value' ] ) ) { $ response = $ this -> extNodes [ 'setting' ] [ 'value' ] ; if ( is_array ( $ response ) ) { $ response = '' ; } } break ; case self :: EXT_WRITE : $ this -> setSetting ( 'ext_ims_lti_tool_setting' , $ value ) ; $ this -> saveSettings ( ) ; $ response = true ; break ; case self :: EXT_DELETE : $ response = true ; break ; } } } return $ response ; }
docstring: Perform a Setting service request.
  
  @param int    $action The action type constant
  @param string $value  The setting value (optional, default is null)
  
  @return mixed The setting value for a read action, true if a write or delete action was successful, otherwise false
docstring_tokens: Perform a Setting service request .