protected function registerTables()
    {
        $tables = $this->container->make('config')->get('swoole.tables', []);

        foreach ($tables as $key => $value) {
            $table   = new SwooleTable($value['size']);
            $columns = $value['columns'] ?? [];
            foreach ($columns as $column) {
                if (isset($column['size'])) {
                    $table->column($column['name'], $column['type'], $column['size']);
                } else {
                    $table->column($column['name'], $column['type']);
                }
            }
            $table->create();

            $this->currentTable->add($key, $table);
        }
    }
protected function registerTables()
    {
        $tables = $this->container->make('config')->get('swoole.tables', []);

        foreach ($tables as $key => $value) {
            $table   = new SwooleTable($value['size']);
            $columns = $value['columns'] ?? [];
            foreach ($columns as $column) {
                if (isset($column['size'])) {
                    $table->column($column['name'], $column['type'], $column['size']);
                } else {
                    $table->column($column['name'], $column['type']);
                }
            }
            $table->create();

            $this->currentTable->add($key, $table);
        }
    }
protected function registerTables ( ) { $ tables = $ this -> container -> make ( 'config' ) -> get ( 'swoole.tables' , [ ] ) ; foreach ( $ tables as $ key => $ value ) { $ table = new SwooleTable ( $ value [ 'size' ] ) ; $ columns = $ value [ 'columns' ] ?? [ ] ; foreach ( $ columns as $ column ) { if ( isset ( $ column [ 'size' ] ) ) { $ table -> column ( $ column [ 'name' ] , $ column [ 'type' ] , $ column [ 'size' ] ) ; } else { $ table -> column ( $ column [ 'name' ] , $ column [ 'type' ] ) ; } } $ table -> create ( ) ; $ this -> currentTable -> add ( $ key , $ table ) ; } }
Register user-defined swoole tables.
Register user - defined swoole tables .