AbstractUtil
in package
Abstract class defining database / table creation methods
Table of Contents
- __construct() : mixed
- Save a reference to the connection object for later use
- backupData() : string
- Return an SQL file with the database data as insert statements
- backupStructure() : string
- Return an SQL file with the database table structure
- createTable() : string
- Convenience public function to generate sql for creating a db table
- deleteTable() : string
- Drop the selected table
- getDriver() : DriverInterface
- Get the driver object for the current connection
Methods
__construct()
Save a reference to the connection object for later use
public
__construct(DriverInterface $connection) : mixed
Parameters
- $connection : DriverInterface
Return values
mixed —backupData()
Return an SQL file with the database data as insert statements
public
abstract backupData() : string
Tags
Return values
string —backupStructure()
Return an SQL file with the database table structure
public
abstract backupStructure() : string
Tags
Return values
string —createTable()
Convenience public function to generate sql for creating a db table
public
createTable(string $name, array<string|int, mixed> $fields[, array<string|int, mixed> $constraints = [] ][, bool $ifNotExists = TRUE ]) : string
Parameters
- $name : string
- $fields : array<string|int, mixed>
- $constraints : array<string|int, mixed> = []
- $ifNotExists : bool = TRUE
Return values
string —deleteTable()
Drop the selected table
public
deleteTable(string $name) : string
Parameters
- $name : string
Return values
string —getDriver()
Get the driver object for the current connection
public
getDriver() : DriverInterface