src/Titon/Db/Repository.php
public function createTable(array $options = [], array $attributes = []) {
        $schema = $this->getSchema();
        $schema->addOptions($options);

        // Create the table
        $status = (bool) $this->query(Query::CREATE_TABLE)
            ->attribute($attributes)
            ->schema($schema)
            ->save();

        // Create the indexes
        if ($status) {
            foreach ($schema->getIndexes() as $index => $columns) {
                $this->query(Query::CREATE_INDEX)
                    ->from($schema->getTable(), $index)
                    ->save($columns);
            }
        }

        return $status;
    }
public function createTable(array $options = [], array $attributes = []) {
        $schema = $this->getSchema();
        $schema->addOptions($options);

        // Create the table
        $status = (bool) $this->query(Query::CREATE_TABLE)
            ->attribute($attributes)
            ->schema($schema)
            ->save();

        // Create the indexes
        if ($status) {
            foreach ($schema->getIndexes() as $index => $columns) {
                $this->query(Query::CREATE_INDEX)
                    ->from($schema->getTable(), $index)
                    ->save($columns);
            }
        }

        return $status;
    }
public function createTable ( array $ options = [ ] , array $ attributes = [ ] ) { $ schema = $ this -> getSchema ( ) ; $ schema -> addOptions ( $ options ) ; // Create the table $ status = ( bool ) $ this -> query ( Query :: CREATE_TABLE ) -> attribute ( $ attributes ) -> schema ( $ schema ) -> save ( ) ; // Create the indexes if ( $ status ) { foreach ( $ schema -> getIndexes ( ) as $ index => $ columns ) { $ this -> query ( Query :: CREATE_INDEX ) -> from ( $ schema -> getTable ( ) , $ index ) -> save ( $ columns ) ; } } return $ status ; }
Create a database table and indexes based off the tables schema.
The schema must be an array of column data.

@param array $options
@param array $attributes
@return bool
Create a database table and indexes based off the tables schema . The schema must be an array of column data .