src/Shell/Task/ImportTask.php
protected function getImportErrors(EntityInterface $entity): array
    {
        $result = [];

        /**
         * @var array $errors
         */
        $errors = $entity->errors();

        if (empty($errors)) {
            return $result;
        }

        foreach ($errors as $field => $error) {
            $msg = "[$field] ";
            $msg .= is_array($error) ? implode(', ', $error) : $error;
            $result[] = $msg;
        }

        return $result;
    }
protected function getImportErrors(EntityInterface $entity): array
    {
        $result = [];

        /**
         * @var array $errors
         */
        $errors = $entity->errors();

        if (empty($errors)) {
            return $result;
        }

        foreach ($errors as $field => $error) {
            $msg = "[$field] ";
            $msg .= is_array($error) ? implode(', ', $error) : $error;
            $result[] = $msg;
        }

        return $result;
    }
protected function getImportErrors ( EntityInterface $ entity ) : array { $ result = [ ] ; /**
         * @var array $errors
         */ $ errors = $ entity -> errors ( ) ; if ( empty ( $ errors ) ) { return $ result ; } foreach ( $ errors as $ field => $ error ) { $ msg = "[$field] " ; $ msg .= is_array ( $ error ) ? implode ( ', ' , $ error ) : $ error ; $ result [ ] = $ msg ; } return $ result ; }
Get import errors from entity object.

@param  \Cake\Datasource\EntityInterface $entity Entity instance
@return string[]
Get import errors from entity object .