src/RocknRoot/StrayFw/Database/Console.php
public function mappings(Request $request)
    {
        $table = new \cli\Table();
        $table->setHeaders([ 'Mapping', 'Database', 'Models path' ]);
        $rows = [];
        $mappings = Mapping::getMappings();
        usort($mappings, function (array $a, array $b) {
            return strcmp($a['config']['name'], $b['config']['name']);
        });
        foreach ($mappings as $mapping) {
            $rows[] = [
                $mapping['config']['name'],
                $mapping['config']['database'],
                $mapping['config']['models']['path'],
            ];
        }
        $table->setRows($rows);
        $table->display();
    }
public function mappings(Request $request)
    {
        $table = new \cli\Table();
        $table->setHeaders([ 'Mapping', 'Database', 'Models path' ]);
        $rows = [];
        $mappings = Mapping::getMappings();
        usort($mappings, function (array $a, array $b) {
            return strcmp($a['config']['name'], $b['config']['name']);
        });
        foreach ($mappings as $mapping) {
            $rows[] = [
                $mapping['config']['name'],
                $mapping['config']['database'],
                $mapping['config']['models']['path'],
            ];
        }
        $table->setRows($rows);
        $table->display();
    }
public function mappings ( Request $ request ) { $ table = new \ cli \ Table ( ) ; $ table -> setHeaders ( [ 'Mapping' , 'Database' , 'Models path' ] ) ; $ rows = [ ] ; $ mappings = Mapping :: getMappings ( ) ; usort ( $ mappings , function ( array $ a , array $ b ) { return strcmp ( $ a [ 'config' ] [ 'name' ] , $ b [ 'config' ] [ 'name' ] ) ; } ) ; foreach ( $ mappings as $ mapping ) { $ rows [ ] = [ $ mapping [ 'config' ] [ 'name' ] , $ mapping [ 'config' ] [ 'database' ] , $ mapping [ 'config' ] [ 'models' ] [ 'path' ] , ] ; } $ table -> setRows ( $ rows ) ; $ table -> display ( ) ; }
List registered mappings.

@param Request $request current CLI request
List registered mappings .