original_string: protected function _nestedErrors($field)
      {
          $path = explode('.', $field);
  
          // Only one path element, check for nested entity with error.
          if (count($path) === 1) {
              return $this->_readError($this->get($path[0]));
          }
  
          $entity = $this;
          $len = count($path);
          while ($len) {
              $part = array_shift($path);
              $len = count($path);
              $val = null;
              if ($entity instanceof EntityInterface) {
                  $val = $entity->get($part);
              } elseif (is_array($entity)) {
                  $val = isset($entity[$part]) ? $entity[$part] : false;
              }
  
              if (is_array($val) ||
                  $val instanceof Traversable ||
                  $val instanceof EntityInterface
              ) {
                  $entity = $val;
              } else {
                  $path[] = $part;
                  break;
              }
          }
          if (count($path) <= 1) {
              return $this->_readError($entity, array_pop($path));
          }
  
          return [];
      }
code: protected function _nestedErrors($field)
      {
          $path = explode('.', $field);
  
          // Only one path element, check for nested entity with error.
          if (count($path) === 1) {
              return $this->_readError($this->get($path[0]));
          }
  
          $entity = $this;
          $len = count($path);
          while ($len) {
              $part = array_shift($path);
              $len = count($path);
              $val = null;
              if ($entity instanceof EntityInterface) {
                  $val = $entity->get($part);
              } elseif (is_array($entity)) {
                  $val = isset($entity[$part]) ? $entity[$part] : false;
              }
  
              if (is_array($val) ||
                  $val instanceof Traversable ||
                  $val instanceof EntityInterface
              ) {
                  $entity = $val;
              } else {
                  $path[] = $part;
                  break;
              }
          }
          if (count($path) <= 1) {
              return $this->_readError($entity, array_pop($path));
          }
  
          return [];
      }
code_tokens: protected function _nestedErrors ( $ field ) { $ path = explode ( '.' , $ field ) ; // Only one path element, check for nested entity with error. if ( count ( $ path ) === 1 ) { return $ this -> _readError ( $ this -> get ( $ path [ 0 ] ) ) ; } $ entity = $ this ; $ len = count ( $ path ) ; while ( $ len ) { $ part = array_shift ( $ path ) ; $ len = count ( $ path ) ; $ val = null ; if ( $ entity instanceof EntityInterface ) { $ val = $ entity -> get ( $ part ) ; } elseif ( is_array ( $ entity ) ) { $ val = isset ( $ entity [ $ part ] ) ? $ entity [ $ part ] : false ; } if ( is_array ( $ val ) || $ val instanceof Traversable || $ val instanceof EntityInterface ) { $ entity = $ val ; } else { $ path [ ] = $ part ; break ; } } if ( count ( $ path ) <= 1 ) { return $ this -> _readError ( $ entity , array_pop ( $ path ) ) ; } return [ ] ; }
docstring: Auxiliary method for getting errors in nested entities
  
  @param string $field the field in this entity to check for errors
  @return array errors in nested entity if any
docstring_tokens: Auxiliary method for getting errors in nested entities