PHP Interface Fakerino\Core\Database\DbInterface

Author: Nicola Pietroluongo ([email protected])
显示文件 Open project: fakerino/fakerino Interface Usage Examples

Public Methods

Method Description
connect ( ) : boolean Makes a database connection.
getColumnLength ( integer $num ) : integer Returns the length of the $num column.
getColumnName ( integer $num ) : string Returns the name of the $num column.
getColumnType ( integer $num ) : string Returns the type of the $num column.
getFakeType ( string $columnType ) : string Gets the Fakerino columnType.
getTotalColumns ( ) : integer Gets the number of column in the table.
insert ( DbRowEntity $row ) : boolean Inserts row in $tableName.
isColumnAutoincrement ( integer $num ) : boolean Returns true if the column is autoincrement.
setTable ( string $tableName ) Sets the connection with the $tableName.

Method Details

connect() public method

Makes a database connection.
public connect ( ) : boolean
return boolean

getColumnLength() public method

Returns the length of the $num column.
public getColumnLength ( integer $num ) : integer
$num integer
return integer

getColumnName() public method

Returns the name of the $num column.
public getColumnName ( integer $num ) : string
$num integer
return string mixed

getColumnType() public method

Returns the type of the $num column.
public getColumnType ( integer $num ) : string
$num integer
return string

getFakeType() public method

Gets the Fakerino columnType.
public getFakeType ( string $columnType ) : string
$columnType string
return string

getTotalColumns() public method

Gets the number of column in the table.
public getTotalColumns ( ) : integer
return integer

insert() public method

Inserts row in $tableName.
public insert ( DbRowEntity $row ) : boolean
$row DbRowEntity
return boolean

isColumnAutoincrement() public method

Returns true if the column is autoincrement.
public isColumnAutoincrement ( integer $num ) : boolean
$num integer
return boolean

setTable() public method

Sets the connection with the $tableName.
public setTable ( string $tableName )
$tableName string