Class Create
adds values to a PDO connected resource
-
DSchoenbauer\Sql\Command\Create
implements
DSchoenbauer\Sql\Command\CommandInterface
Methods summary
public
|
#
__construct( string $table, array $data )
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
Since
v1.0.0
|
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
|
#
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
string will return the lastInsertId from the PDO connection object
Throws
Since
v1.0.0
Implementation of
|
public
string
|
#
getTable( )
retrieves the table with which you wish to append to
retrieves the table with which you wish to append to
Returns
string table with which you wish to append to
Since
v1.0.0
|
public
array
|
#
getData( )
retrieves the data that is used to generate the create statement. The
fields of the array are used to generate the field list.
retrieves the data that is used to generate the create 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 added
into the table
Since
v1.0.0
Implementation of
|
public
DSchoenbauer\Sql\Command\Create
|
#
setTable( string $table )
defines a table with which you wish to append to
defines a table with which you wish to append to
Parameters
- $table
- a table with which you wish to append to
Returns
Since
v1.0.0
|
public
DSchoenbauer\Sql\Command\Create
|
#
setData( array $data )
sets the data that is used to generate the create statement. The fields
of the array are used to generate the field list.
sets the data that is used to generate the create 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 new values to be added
into the table
Returns
Since
v1.0.0
|