Example #1
0
 /**
  * More convenient error messages
  *
  * @param modProcessorResponse $response
  * @param string $glue
  *
  * @return string
  */
 public function formatProcessorErrors(modProcessorResponse $response, $glue = 'br')
 {
     $errormsgs = array();
     if ($response->hasMessage()) {
         $errormsgs[] = $response->getMessage();
     }
     if ($response->hasFieldErrors()) {
         if ($errors = $response->getFieldErrors()) {
             foreach ($errors as $error) {
                 $errormsgs[] = $error->message;
             }
         }
     }
     return implode($glue, $errormsgs);
 }