src/Utility/Import.php
public function create(ImportsTable $table, ImportEntity $entity, string $filename) : bool
    {
        $modelName = $this->request->getParam('controller');
        if ($this->request->getParam('plugin')) {
            $modelName = $this->request->getParam('plugin') . '.' . $modelName;
        }

        $data = [
            'filename' => $filename,
            'status' => $table::STATUS_PENDING,
            'model_name' => $modelName,
            'attempts' => 0
        ];

        $entity = $table->patchEntity($entity, $data);

        return (bool)$table->save($entity);
    }
public function create(ImportsTable $table, ImportEntity $entity, string $filename) : bool
    {
        $modelName = $this->request->getParam('controller');
        if ($this->request->getParam('plugin')) {
            $modelName = $this->request->getParam('plugin') . '.' . $modelName;
        }

        $data = [
            'filename' => $filename,
            'status' => $table::STATUS_PENDING,
            'model_name' => $modelName,
            'attempts' => 0
        ];

        $entity = $table->patchEntity($entity, $data);

        return (bool)$table->save($entity);
    }
public function create ( ImportsTable $ table , ImportEntity $ entity , string $ filename ) : bool { $ modelName = $ this -> request -> getParam ( 'controller' ) ; if ( $ this -> request -> getParam ( 'plugin' ) ) { $ modelName = $ this -> request -> getParam ( 'plugin' ) . '.' . $ modelName ; } $ data = [ 'filename' => $ filename , 'status' => $ table :: STATUS_PENDING , 'model_name' => $ modelName , 'attempts' => 0 ] ; $ entity = $ table -> patchEntity ( $ entity , $ data ) ; return ( bool ) $ table -> save ( $ entity ) ; }
Create import record.

@param \CsvMigrations\Model\Table\ImportsTable $table Table instance
@param \CsvMigrations\Model\Entity\Import $entity Import entity
@param string $filename Uploaded file name
@return bool
Create import record .