Delete class
This class holds all the information regarding DELETE operation, that will be used by Database class.
Example
$deleteOperation = new Delete('User');
$deleteOperation->where('id', '=', '1');
$deleteOperation->exec();
package |
Default |
---|
__construct(string $table) : void
string
Name of the database table where the DELETE operation will happen
exec() : boolean
Execute the constructed DELETE operation
boolean
toString() : string
Return the SQL query
Example
$deleteOperation = new Delete('User');
$deleteOperation->where('id', '=', '1');
echo $deleteOperation->toString();
// Returns "DELETE FROM User WHERE id = '1'"
string
where(string $column, string $operator, string $value = '') : \TinyORM\Delete
Add where condition in this DELETE operation
string
Name of the database table column
string
SQL operator =, <, >, <> etc
string
Value to the compared with the value in $column and $operator
\TinyORM\Delete
table : string
var |
Database table |
---|
string
where : array
var |
Where |
---|
array