/** * Set object-specific model-layer errors for classes that implement the getErrors/addFieldError methods */ public function setObjectErrors() { if (method_exists($this->object, 'getErrors')) { $errors = $this->object->getErrors(); foreach ($errors as $k => $msg) { $this->addFieldError($k, $msg); } } }