Overview

Namespaces

  • DSchoenbauer
    • Sql
      • Command
      • Exception
      • Where

Classes

  • Create
  • Delete
  • Select
  • Update

Interfaces

  • CommandInterface

Traits

  • WhereTrait
  • Overview
  • Namespace
  • Class

Class Delete

removes records from a PDO connected resource

DSchoenbauer\Sql\Command\Delete implements DSchoenbauer\Sql\Command\CommandInterface uses DSchoenbauer\Sql\Command\WhereTrait
Namespace: DSchoenbauer\Sql\Command
Author: David Schoenbauer dschoenbauer@gmail.com
Located at Sql/Command/Delete.php
Methods summary
public
# __construct( string $table, DSchoenbauer\Sql\Where\WhereStatementInterface $where = null )

Parameters

$table
table with which you wish to remove records from
$where

an object that is designed to return a where statement to limit the data that is affected by the delete

Since

v1.0.0
public boolean
# execute( PDO $pdo )

takes the SQL and the data provided and executes the query with the data

takes the SQL and the data provided and executes the query with the data

Parameters

$pdo
a connection object that defines where the connection is to be executed

Returns

boolean
TRUE on success or FALSE on failure.

Throws

DSchoenbauer\Sql\Exception\ExecutionErrorException
thrown when any exception or SQL failure occurs

Since

v1.0.0

Implementation of

DSchoenbauer\Sql\Command\CommandInterface::execute()
public array
# getData( )

retrieves the data that is uses to fulfill the requirements of a prepared statement

retrieves the data that is uses to fulfill the requirements of a prepared statement

Returns

array

a single level associative array containing keys that represent the fields and values that represent items to fulfill the requirements of a prepared statement

Since

v1.0.0

Implementation of

DSchoenbauer\Sql\Command\CommandInterface::getData()
public string
# getSql( )

Generates a SQL statement ready to be prepared for execution with the intent of removing data

Generates a SQL statement ready to be prepared for execution with the intent of removing data

Returns

string
a string that represents a delete statement ready to be prepared by PDO

Since

v1.0.0

Implementation of

DSchoenbauer\Sql\Command\CommandInterface::getSql()
public string
# getTable( )

retrieves the table with which you wish to remove from

retrieves the table with which you wish to remove from

Returns

string
table with which you wish to remove from

Since

v1.0.0
public DSchoenbauer\Sql\Command\Delete
# setTable( string $table )

defines a table with which you wish to remove from

defines a table with which you wish to remove from

Parameters

$table
table with which you wish to remove from

Returns

DSchoenbauer\Sql\Command\Delete
for method chaining

Since

v1.0.0
Methods used from DSchoenbauer\Sql\Command\WhereTrait
getWhere(), getWhereData(), getWhereStatement(), hasWhere(), setWhere()
API documentation generated by ApiGen