Class Update
updates values in a PDO connected resource
-
DSchoenbauer\Sql\Command\Update
implements
DSchoenbauer\Sql\Command\CommandInterface
uses
DSchoenbauer\Sql\Command\WhereTrait
Methods summary
public
|
#
__construct( string $table, array $data, DSchoenbauer\Sql\Where\WhereStatementInterface $where = null )
Parameters
- $table
- table with which you wish to append to
- $data
a single level associative array containing keys that
represent the fields and values that represent new values to be added into
the table
- $where
an object that is designed to return
a where statement to limit the data that is affected by the update
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
Since
v1.0.0
Implementation of
|
public
string
|
#
getSql( )
Generates a SQL statement ready to be prepared for execution with the
intent of updating data
Generates a SQL statement ready to be prepared for execution with the
intent of updating data
Returns
string a string that represents an update statement ready to be
prepared by PDO
Throws
Since
v1.0.0
Implementation of
|
public
string
|
#
getTable( )
retrieves the table with which you wish to update
retrieves the table with which you wish to update
Returns
string table with which you wish to update
Since
v1.0.0
|
public
DSchoenbauer\Sql\Command\Update
|
#
setTable( string $table )
defines a table with which you wish to update
defines a table with which you wish to update
Parameters
- $table
- a table with which you wish to update
Returns
Since
v1.0.0
|
public
array
|
#
getCombinedData( )
Returns a combination of data from Where statement and from this object
Returns a combination of data from Where statement and from this object
Returns
array
Since
v1.0.0
|
public
array
|
#
getData( )
retrieves the data that is used to generate the update statement. The
fields of the array are used to generate the field list.
retrieves the data that is used to generate the update statement. The
fields of the array are used to generate the field list.
Returns
array a single level associative array containing keys that
represent the fields and values that represent new values to be updated in the table
Since
v1.0.0
Implementation of
|
public
DSchoenbauer\Sql\Command\Update
|
#
setData( array $data )
sets the data that is used to generate the update statement. The fields
of the array are used to generate the field list.
sets the data that is used to generate the update statement. The fields
of the array are used to generate the field list.
Parameters
- $data
a single level associative array containing keys that
represent the fields and values that represent values to be updated into the table
Returns
Since
v1.0.0
|