/**
* Get the result data array
*/
- public function getResultData() {
+ public function & getResultData() {
return $this->getResult()->getData();
}
* notice any changes in API.
*/
public function setWarning($warning) {
- $data = $this->getResult()->getData();
+ # If there is a warning already, append it to the existing one
+ $data =& $this->getResult()->getData();
if(isset($data['warnings'][$this->getModuleName()]))
{
# Don't add duplicate warnings
$warn_regex = preg_quote($warning, '/');
if(preg_match("/{$warn_regex}(\\n|$)/", $data['warnings'][$this->getModuleName()]['*']))
return;
- $oldwarning = $data['warnings'][$this->getModuleName()]['*'];
- # If there is a warning already, append it to the existing one
- $warning = "$oldwarning\n$warning";
- $this->getResult()->unsetValue('warnings', $this->getModuleName());
+ $warning = "{$data['warnings'][$this->getModuleName()]['*']}\n$warning";
+ unset($data['warnings'][$this->getModuleName()]);
}
$msg = array();
ApiResult :: setContent($msg, $warning);
- $this->getResult()->disableSizeCheck();
$this->getResult()->addValue('warnings', $this->getModuleName(), $msg);
- $this->getResult()->enableSizeCheck();
}
/**
/**
* Using getAllowedParams(), makes an array of the values provided by the user,
* with key being the name of the variable, and value - validated value from user or default.
- * This method can be used to generate local variables using extract().
* limit=max will not be parsed if $parseMaxLimit is set to false; use this
* when the max limit is not definite, e.g. when getting revisions.
*/