src/Utility/Import.php
public function getImportResults(ImportEntity $entity, array $columns) : QueryInterface
    {
        $sortCol = Hash::get($this->request->getQueryParams(), 'order.0.column', 0);
        $sortCol = array_key_exists($sortCol, $columns) ? $columns[$sortCol] : current($columns);

        $sortDir = Hash::get($this->request->getQueryParams(), 'order.0.dir', 'asc');
        if (!in_array($sortDir, ['asc', 'desc'])) {
            $sortDir = 'asc';
        }

        $table = TableRegistry::get('CsvMigrations.ImportResults');

        $query = $table->find('all')
            ->where([$table->aliasField('import_id') => $entity->id])
            ->order([$table->aliasField($sortCol) => $sortDir]);

        return $query;
    }
public function getImportResults(ImportEntity $entity, array $columns) : QueryInterface
    {
        $sortCol = Hash::get($this->request->getQueryParams(), 'order.0.column', 0);
        $sortCol = array_key_exists($sortCol, $columns) ? $columns[$sortCol] : current($columns);

        $sortDir = Hash::get($this->request->getQueryParams(), 'order.0.dir', 'asc');
        if (!in_array($sortDir, ['asc', 'desc'])) {
            $sortDir = 'asc';
        }

        $table = TableRegistry::get('CsvMigrations.ImportResults');

        $query = $table->find('all')
            ->where([$table->aliasField('import_id') => $entity->id])
            ->order([$table->aliasField($sortCol) => $sortDir]);

        return $query;
    }
public function getImportResults ( ImportEntity $ entity , array $ columns ) : QueryInterface { $ sortCol = Hash :: get ( $ this -> request -> getQueryParams ( ) , 'order.0.column' , 0 ) ; $ sortCol = array_key_exists ( $ sortCol , $ columns ) ? $ columns [ $ sortCol ] : current ( $ columns ) ; $ sortDir = Hash :: get ( $ this -> request -> getQueryParams ( ) , 'order.0.dir' , 'asc' ) ; if ( ! in_array ( $ sortDir , [ 'asc' , 'desc' ] ) ) { $ sortDir = 'asc' ; } $ table = TableRegistry :: get ( 'CsvMigrations.ImportResults' ) ; $ query = $ table -> find ( 'all' ) -> where ( [ $ table -> aliasField ( 'import_id' ) => $ entity -> id ] ) -> order ( [ $ table -> aliasField ( $ sortCol ) => $ sortDir ] ) ; return $ query ; }
Import results getter.

@param \CsvMigrations\Model\Entity\Import $entity Import entity
@param string[] $columns Display columns
@return \Cake\Datasource\QueryInterface
Import results getter .