public function create(): bool
    {
        if ($this->isCreate()) {
            throw new Exception\RuntimeException('Memory table have been created, cannot recreated');
        }

        // Init memory table instace
        $table = new SwooleTable($this->getSize());
        $this->setTable($table);

        // Set columns
        foreach ($this->columns as $field => $fieldValue) {
            $args = array_merge([$field], $fieldValue);
            $this->table->column(...$args);
        }

        // Create memory table
        $result = $table->create();

        // Change memory table create status
        $this->setCreate(true);
        return $result;
    }
public function create(): bool
    {
        if ($this->isCreate()) {
            throw new Exception\RuntimeException('Memory table have been created, cannot recreated');
        }

        // Init memory table instace
        $table = new SwooleTable($this->getSize());
        $this->setTable($table);

        // Set columns
        foreach ($this->columns as $field => $fieldValue) {
            $args = array_merge([$field], $fieldValue);
            $this->table->column(...$args);
        }

        // Create memory table
        $result = $table->create();

        // Change memory table create status
        $this->setCreate(true);
        return $result;
    }
public function create ( ) : bool { if ( $ this -> isCreate ( ) ) { throw new Exception \ RuntimeException ( 'Memory table have been created, cannot recreated' ) ; } // Init memory table instace $ table = new SwooleTable ( $ this -> getSize ( ) ) ; $ this -> setTable ( $ table ) ; // Set columns foreach ( $ this -> columns as $ field => $ fieldValue ) { $ args = array_merge ( [ $ field ] , $ fieldValue ) ; $ this -> table -> column ( ... $ args ) ; } // Create memory table $ result = $ table -> create ( ) ; // Change memory table create status $ this -> setCreate ( true ) ; return $ result ; }
Create table by columes

@return bool
@throws Exception\RuntimeException When memory table have been created
@throws Exception\InvalidArgumentException
Create table by columes