Index
-
\com\setasign\SetaFramework
-
Database
- ConnectionException
- Database
- DatabaseConnectionManager
- DiRowFactory
- Driver
- DummyRowFactory
- Expression
- ExpressionInterface
- Identifier
- JoinedTable
- Manager
- Migration
- Query
- QuoteInterface
- QuoteLaterExpression
- RowFactoryInterface
- SqlInterface
- Table
- TableFactoryInterface
- TableInterface
- TableSelectInterface
- ValueExpression
-
Database
com\setasign\SetaFramework\Database
TableInterface Class TableInterface
File: /SetaFramework/src/Database/TableInterface.php
Implemented in
Summary
Methods
createRow()
Creates a row object for this table instance (but doesn't save it)
Parameters
- $data : array
delete()
Delete from the database table
Be careful with this method!! A wrong $where-condition can delete every row in the table.
If you use aliases for columns you can't use the alias in the where condition. You will have to use the real column name.
You can't filter for magical columns in this method!
$where can be an Closure. The Closure will be called with (Query\Delete $query, Database $db) and has no return. $query won't be inserted directly, only the added where-parts (where, whereOr, whereParentheseOpen, whereOrParentheseOpen, whereParenthesClose) will be used.
Parameters
- $where : string|callable
find()
Return a result of a database query fetched by primary key
Parameters
- $primaryKey : int|string|array<string, mixed>
- $row : ?Table\Row
getHiddenColumns()
Get all hidden columns which won't get exposed through the toArray() method of a table row
insert()
Insert a row into the table.
$data need to be an array, where the key is the column and the value is the new value. If an column of this array isn't defined in the table, this will skipped!
Parameters
- $data : array
Return Values
Returns the last inserted id
update()
Updates one or more rows in the table.
Be careful with this method!! A wrong or missing $where-condition can edit every row in the table.
$data need to be an array, where the key is the column and the value is the new value. If an column of this array isn't defined in the table, this will skipped!
$where can be an Closure. The Closure will be called with (Query\Update $query, Database $db) and has no return. $query won't be inserted directly, only the added where-parts (where, whereOr, whereParentheseOpen, whereOrParentheseOpen, whereParenthesClose) will be used.
Parameters
- $data : array
- $where : null|string|callable
