Delete

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

Methods

__construct

__construct(string $table) : void

Arguments

$table

string

Name of the database table where the DELETE operation will happen

exec

exec() : boolean

Execute the constructed DELETE operation

Response

boolean

toString

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'"

Response

string

where

where(string $column, string $operator, string $value = '') : \TinyORM\Delete

Add where condition in this DELETE operation

Arguments

$column

string

Name of the database table column

$operator

string

SQL operator =, <, >, <> etc

$value

string

Value to the compared with the value in $column and $operator

Response

\TinyORM\Delete

Properties

Database table

table : string
var

Database table

Type(s)

string

Where

where : array
var

Where

Type(s)

array