Browse Source

Improve _readError to not use deprecated methods.

Mark Story 8 years ago
parent
commit
7e2cb9b630
1 changed files with 5 additions and 2 deletions
  1. 5 2
      src/Datasource/EntityTrait.php

+ 5 - 2
src/Datasource/EntityTrait.php

@@ -1083,13 +1083,16 @@ trait EntityTrait
      */
     protected function _readError($object, $path = null)
     {
+        if ($path !== null && $object instanceof EntityInterface) {
+            return $object->getError($path);
+        }
         if ($object instanceof EntityInterface) {
-            return $object->errors($path);
+            return $object->getErrors();
         }
         if (is_array($object)) {
             $array = array_map(function ($val) {
                 if ($val instanceof EntityInterface) {
-                    return $val->errors();
+                    return $val->getErrors();
                 }
             }, $object);