src/Shell/ImportShell.php
protected function _importFail(ImportResult $entity, array $errors) : bool
    {
        $table = TableRegistry::get('CsvMigrations.ImportResults');
        Assert::isInstanceOf($table, ImportResultsTable::class);

        $entity->set('status', $table::STATUS_FAIL);
        $message = sprintf($table::STATUS_FAIL_MESSAGE, json_encode($errors));
        $entity->set('status_message', $message);

        return (bool)$table->save($entity);
    }
protected function _importFail(ImportResult $entity, array $errors) : bool
    {
        $table = TableRegistry::get('CsvMigrations.ImportResults');
        Assert::isInstanceOf($table, ImportResultsTable::class);

        $entity->set('status', $table::STATUS_FAIL);
        $message = sprintf($table::STATUS_FAIL_MESSAGE, json_encode($errors));
        $entity->set('status_message', $message);

        return (bool)$table->save($entity);
    }
protected function _importFail ( ImportResult $ entity , array $ errors ) : bool { $ table = TableRegistry :: get ( 'CsvMigrations.ImportResults' ) ; Assert :: isInstanceOf ( $ table , ImportResultsTable :: class ) ; $ entity -> set ( 'status' , $ table :: STATUS_FAIL ) ; $ message = sprintf ( $ table :: STATUS_FAIL_MESSAGE , json_encode ( $ errors ) ) ; $ entity -> set ( 'status_message' , $ message ) ; return ( bool ) $ table -> save ( $ entity ) ; }
Mark import result as failed.

@param \CsvMigrations\Model\Entity\ImportResult $entity ImportResult entity
@param mixed[] $errors Fail errors
@return bool
Mark import result as failed .