resultsText() public method

Get the validation results as a string of text.
public resultsText ( ) : string
return string Returns the validation results.
 /**
  * Validate data to be used as class properties.
  *
  * @param array $Parameters .
  * @return string|true True on success or string (message) on error.
  */
 public function validate($Parameters = array())
 {
     $validation = new Gdn_Validation();
     // Validate integer properties.
     $validation->applyRule('expiry', 'Integer');
     $validation->applyRule('limit', 'Integer');
     $validation->applyRule('bodylimit', 'Integer');
     $validation->applyRule('titlelimit', 'Integer');
     $validation->applyRule('group', 'Integer');
     // Validate selection.
     $validation->applyRule('selection', 'String');
     // Validate selector.
     $validation->applyRule('selector', 'Required');
     $selectorWhitelist = array('role', 'rank', 'category', 'score', 'promoted');
     if (isset($Parameters['selector']) && !in_array($Parameters['selector'], $selectorWhitelist)) {
         $validation->addValidationResult('selector', 'Invalid selector.');
     }
     // Validate ContentType.
     $typeWhitelist = array('all', 'discussions', 'comments');
     if (isset($Parameters['contenttype']) && !in_array($Parameters['contenttype'], $typeWhitelist)) {
         $validation->addValidationResult('contenttype', 'Invalid contenttype.');
     }
     $result = $validation->validate($Parameters);
     return $result === true ? true : $validation->resultsText();
 }