class AbstractTable (View source)

Class DatabaseTable

Methods

__construct(string $table, AbstractDatabaseDriver $db)

Constructor.

create(callable|Schema $callback, bool $ifNotExists = true, array $options = array())

create

update(callable|Schema $schema)

update

$this
save(callable|Schema $schema, bool $ifNotExists = true, array $options = array())

save

drop(bool $ifExists = true, string $option = '')

drop

boolean
exists()

exists

$this
rename(string $newName, boolean $returnNew = true)

rename

lock()

Locks a table in the database.

truncate()

Method to truncate a table.

array|boolean
getDetail()

getDetail

array
getColumns(bool $refresh = false)

Get table columns.

mixed
getColumnDetails(bool $refresh = false)

getColumnDetails

getColumnDetail(string $column)

getColumnDetail

boolean
hasColumn(string $column)

hasColumn

addColumn(string $name, string $type = 'text', bool $signed = true, bool $allowNull = true, string $default = '', string $comment = '', array $options = array())

addColumn

dropColumn(string $name)

dropColumn

modifyColumn(string|Column $name, string $type = 'text', bool $signed = true, bool $allowNull = true, string $default = '', string $comment = '', array $options = array())

modifyColumn

changeColumn(string $oldName, string|Column $newName, string $type = 'text', bool $signed = true, bool $allowNull = true, string $default = '', string $comment = '', array $options = array())

changeColumn

addIndex(string $type, array $columns = array(), string $name = null, string $comment = null, array $options = array())

addIndex

dropIndex(string $name)

dropIndex

array
getIndexes()

getIndexes

boolean
hasIndex(string $name)

hasIndex

string
getName()

Method to get property Table

setName(string $name)

Method to set property table

getDriver()

Method to get property Db

setDriver(AbstractDatabaseDriver $db)

Method to set property db

getSchema()

getSchema

getDatabase()

Method to get property Database

setDatabase(AbstractDatabase $database)

Method to set property database

getDataType()

getTypeMapper

Details

at line line 64
__construct(string $table, AbstractDatabaseDriver $db)

Constructor.

Parameters

string $table
AbstractDatabaseDriver $db

at line line 80
abstract AbstractTable create(callable|Schema $callback, bool $ifNotExists = true, array $options = array())

create

Parameters

callable|Schema $callback
bool $ifNotExists
array $options

Return Value

AbstractTable

at line line 89
AbstractTable update(callable|Schema $schema)

update

Parameters

callable|Schema $schema

Return Value

AbstractTable

at line line 115
$this save(callable|Schema $schema, bool $ifNotExists = true, array $options = array())

save

Parameters

callable|Schema $schema
bool $ifNotExists
array $options

Return Value

$this

at line line 142
AbstractTable drop(bool $ifExists = true, string $option = '')

drop

Parameters

bool $ifExists
string $option

Return Value

AbstractTable

at line line 158
boolean exists()

exists

Return Value

boolean

at line line 173
abstract $this rename(string $newName, boolean $returnNew = true)

rename

Parameters

string $newName
boolean $returnNew

Return Value

$this

at line line 183
AbstractTable lock()

Locks a table in the database.

Return Value

AbstractTable Returns this object to support chaining.

Exceptions

RuntimeException

at line line 197
AbstractTable unlock()

unlock

Return Value

AbstractTable Returns this object to support chaining.

Exceptions

RuntimeException

at line line 212
AbstractTable truncate()

Method to truncate a table.

Return Value

AbstractTable

Exceptions

RuntimeException

at line line 224
array|boolean getDetail()

getDetail

Return Value

array|boolean

at line line 236
array getColumns(bool $refresh = false)

Get table columns.

Parameters

bool $refresh

Return Value

array Table columns with type.

at line line 248
abstract mixed getColumnDetails(bool $refresh = false)

getColumnDetails

Parameters

bool $refresh

Return Value

mixed

at line line 257
stdClass getColumnDetail(string $column)

getColumnDetail

Parameters

string $column

Return Value

stdClass

at line line 271
boolean hasColumn(string $column)

hasColumn

Parameters

string $column

Return Value

boolean

at line line 289
abstract AbstractTable addColumn(string $name, string $type = 'text', bool $signed = true, bool $allowNull = true, string $default = '', string $comment = '', array $options = array())

addColumn

Parameters

string $name
string $type
bool $signed
bool $allowNull
string $default
string $comment
array $options

Return Value

AbstractTable

at line line 298
AbstractTable dropColumn(string $name)

dropColumn

Parameters

string $name

Return Value

AbstractTable

at line line 327
abstract AbstractTable modifyColumn(string|Column $name, string $type = 'text', bool $signed = true, bool $allowNull = true, string $default = '', string $comment = '', array $options = array())

modifyColumn

Parameters

string|Column $name
string $type
bool $signed
bool $allowNull
string $default
string $comment
array $options

Return Value

AbstractTable

at line line 343
abstract AbstractTable changeColumn(string $oldName, string|Column $newName, string $type = 'text', bool $signed = true, bool $allowNull = true, string $default = '', string $comment = '', array $options = array())

changeColumn

Parameters

string $oldName
string|Column $newName
string $type
bool $signed
bool $allowNull
string $default
string $comment
array $options

Return Value

AbstractTable

at line line 356
abstract AbstractTable addIndex(string $type, array $columns = array(), string $name = null, string $comment = null, array $options = array())

addIndex

Parameters

string $type
array $columns
string $name
string $comment
array $options

Return Value

AbstractTable

at line line 365
abstract AbstractTable dropIndex(string $name)

dropIndex

Parameters

string $name

Return Value

AbstractTable

at line line 372
abstract array getIndexes()

getIndexes

Return Value

array

at line line 381
boolean hasIndex(string $name)

hasIndex

Parameters

string $name

Return Value

boolean

at line line 401
string getName()

Method to get property Table

Return Value

string

at line line 418
AbstractTable setName(string $name)

Method to set property table

Parameters

string $name

Return Value

AbstractTable Return self to support chaining.

at line line 430
AbstractDatabaseDriver getDriver()

Method to get property Db

Return Value

AbstractDatabaseDriver

at line line 442
AbstractTable setDriver(AbstractDatabaseDriver $db)

Method to set property db

Parameters

AbstractDatabaseDriver $db

Return Value

AbstractTable Return self to support chaining.

at line line 454
Schema getSchema()

getSchema

Return Value

Schema

at line line 490
AbstractDatabase getDatabase()

Method to get property Database

Return Value

AbstractDatabase

at line line 502
AbstractTable setDatabase(AbstractDatabase $database)

Method to set property database

Parameters

AbstractDatabase $database

Return Value

AbstractTable Return self to support chaining.

at line line 519
DataType getDataType()

getTypeMapper

Return Value

DataType

at line line 579
AbstractTable reset()

reset

Return Value

AbstractTable