src/Utility/Field.php
public static function getCsvField(RepositoryInterface $table, string $field) : ?CsvField
    {
        if ('' === $field) {
            return null;
        }

        $moduleName = App::shortName(get_class($table), 'Model/Table', 'Table');

        $config = new ModuleConfig(ConfigType::MIGRATION(), $moduleName);
        $parsed = $config->parse();

        if (! property_exists($parsed, $field)) {
            return null;
        }

        $parsed = json_encode($parsed->{$field});
        if (false === $parsed) {
            return null;
        }

        return new CsvField(json_decode($parsed, true));
    }
public static function getCsvField(RepositoryInterface $table, string $field) : ?CsvField
    {
        if ('' === $field) {
            return null;
        }

        $moduleName = App::shortName(get_class($table), 'Model/Table', 'Table');

        $config = new ModuleConfig(ConfigType::MIGRATION(), $moduleName);
        $parsed = $config->parse();

        if (! property_exists($parsed, $field)) {
            return null;
        }

        $parsed = json_encode($parsed->{$field});
        if (false === $parsed) {
            return null;
        }

        return new CsvField(json_decode($parsed, true));
    }
public static function getCsvField ( RepositoryInterface $ table , string $ field ) : ? CsvField { if ( '' === $ field ) { return null ; } $ moduleName = App :: shortName ( get_class ( $ table ) , 'Model/Table' , 'Table' ) ; $ config = new ModuleConfig ( ConfigType :: MIGRATION ( ) , $ moduleName ) ; $ parsed = $ config -> parse ( ) ; if ( ! property_exists ( $ parsed , $ field ) ) { return null ; } $ parsed = json_encode ( $ parsed -> { $ field } ) ; if ( false === $ parsed ) { return null ; } return new CsvField ( json_decode ( $ parsed , true ) ) ; }
CSV field instance getter.

@param \Cake\Datasource\RepositoryInterface $table Table instance
@param string $field Field name
@return \CsvMigrations\FieldHandlers\CsvField|null
CSV field instance getter .