Table
extends AbstractGateway
in package
implements
Countable, IteratorAggregate
Table gateway class
Tags
Table of Contents
Interfaces
- Countable
- IteratorAggregate
Properties
Methods
- __construct() : mixed
- Constructor
- count() : int
- Method to get the count of items in the collection
- delete() : Table
- Delete from a table
- getIterator() : ArrayIterator
- Method to iterate over the table rows
- getNumberOfRows() : int
- Get the number of result rows
- getRows() : array<string|int, mixed>
- Get the result rows
- getTable() : string
- Get the table name
- getTableInfo() : array<string|int, mixed>
- Get table info
- hasRows() : bool
- Has rows
- insert() : Table
- Insert a row of values into the table
- insertRows() : Table
- Insert rows of values into the table
- rows() : array<string|int, mixed>
- Get the result rows (alias method)
- select() : array<string|int, mixed>
- Select rows from the table
- setRows() : Table
- Set all the table rows at once
- toArray() : array<string|int, mixed>
- Method to convert table gateway to an array (alias method)
- update() : Table
- Update a table
Properties
$rows
Result rows
protected
array<string|int, mixed>
$rows
= []
$table
Table
protected
string|null
$table
= null
Methods
__construct()
Constructor
public
__construct(string $table) : mixed
Instantiate the AbstractGateway object.
Parameters
- $table : string
count()
Method to get the count of items in the collection
public
count() : int
Return values
intdelete()
Delete from a table
public
delete([mixed $where = null ][, array<string|int, mixed> $parameters = [] ]) : Table
Parameters
- $where : mixed = null
- $parameters : array<string|int, mixed> = []
Return values
TablegetIterator()
Method to iterate over the table rows
public
getIterator() : ArrayIterator
Return values
ArrayIteratorgetNumberOfRows()
Get the number of result rows
public
getNumberOfRows() : int
Return values
intgetRows()
Get the result rows
public
getRows() : array<string|int, mixed>
Return values
array<string|int, mixed>getTable()
Get the table name
public
getTable() : string
Return values
stringgetTableInfo()
Get table info
public
getTableInfo([AbstractAdapter|null $db = null ]) : array<string|int, mixed>
Parameters
- $db : AbstractAdapter|null = null
Return values
array<string|int, mixed>hasRows()
Has rows
public
hasRows() : bool
Return values
boolinsert()
Insert a row of values into the table
public
insert(array<string|int, mixed> $columns) : Table
Parameters
- $columns : array<string|int, mixed>
Return values
TableinsertRows()
Insert rows of values into the table
public
insertRows(array<string|int, mixed> $values) : Table
Parameters
- $values : array<string|int, mixed>
Return values
Tablerows()
Get the result rows (alias method)
public
rows() : array<string|int, mixed>
Return values
array<string|int, mixed>select()
Select rows from the table
public
select([array<string|int, mixed>|null $columns = null ][, mixed $where = null ][, array<string|int, mixed>|null $parameters = null ][, array<string|int, mixed>|null $options = null ]) : array<string|int, mixed>
Parameters
- $columns : array<string|int, mixed>|null = null
- $where : mixed = null
- $parameters : array<string|int, mixed>|null = null
- $options : array<string|int, mixed>|null = null
Return values
array<string|int, mixed>setRows()
Set all the table rows at once
public
setRows([array<string|int, mixed> $rows = [] ]) : Table
Parameters
- $rows : array<string|int, mixed> = []
Return values
TabletoArray()
Method to convert table gateway to an array (alias method)
public
toArray() : array<string|int, mixed>
Return values
array<string|int, mixed>update()
Update a table
public
update(array<string|int, mixed> $columns[, mixed $where = null ][, array<string|int, mixed>|null $parameters = [] ]) : Table
Parameters
- $columns : array<string|int, mixed>
- $where : mixed = null
- $parameters : array<string|int, mixed>|null = []