interface SqlConnectionInterface implements ConnectionInterface
Interface for Propel Connection object.
Based on the PDO interface.
Methods
setName(string $name) | from ConnectionInterface | |
string | getName() | from ConnectionInterface |
boolean |
beginTransaction()
Turns off autocommit mode. |
from ConnectionInterface |
boolean |
commit()
Commits a transaction. |
from ConnectionInterface |
boolean |
rollBack()
Rolls back a transaction. |
from ConnectionInterface |
bool |
inTransaction()
Checks if inside a transaction. |
from ConnectionInterface |
mixed |
getAttribute(string $attribute)
Retrieve a database connection attribute. |
from ConnectionInterface |
boolean |
setAttribute(string $attribute, mixed $value)
Set an attribute. |
from ConnectionInterface |
string |
lastInsertId(string $name = null)
Returns the ID of the last inserted row or sequence value. |
from ConnectionInterface |
DataFetcherInterface | getSingleDataFetcher($data $data) | from ConnectionInterface |
DataFetcherInterface | getDataFetcher($data $data) | from ConnectionInterface |
int |
exec(string $statement)
Execute an SQL statement and return the number of affected rows. |
|
StatementInterface|bool |
prepare(string $statement, array $driver_options = array())
Prepares a statement for execution and returns a statement object. |
|
DataFetcherInterface |
query(string $statement)
Executes an SQL statement, returning a result set as a Statement object. |
|
string |
quote(string $string, int $parameter_type = 2)
Quotes a string for use in a query. |
Details
in ConnectionInterface at line 25
public
setName(string $name)
in ConnectionInterface at line 30
public string
getName()
in ConnectionInterface at line 43
public boolean
beginTransaction()
Turns off autocommit mode.
While autocommit mode is turned off, changes made to the database via
the Connection object instance are not committed until you end the
transaction by calling Connection::commit().
Calling Connection::rollBack() will roll back all changes to the database
and return the connection to autocommit mode.
in ConnectionInterface at line 53
public boolean
commit()
Commits a transaction.
commit() returns the database connection to autocommit mode until the
next call to connection::beginTransaction() starts a new transaction.
in ConnectionInterface at line 65
public boolean
rollBack()
Rolls back a transaction.
Rolls back the current transaction, as initiated by beginTransaction().
It is an error to call this method if no transaction is active.
If the database was set to autocommit mode, this function will restore
autocommit mode after it has rolled back the transaction.
in ConnectionInterface at line 72
public bool
inTransaction()
Checks if inside a transaction.
in ConnectionInterface at line 83
public mixed
getAttribute(string $attribute)
Retrieve a database connection attribute.
in ConnectionInterface at line 93
public boolean
setAttribute(string $attribute, mixed $value)
Set an attribute.
in ConnectionInterface at line 112
public string
lastInsertId(string $name = null)
Returns the ID of the last inserted row or sequence value.
Returns the ID of the last inserted row, or the last value from a sequence
object, depending on the underlying driver. For example, PDO_PGSQL()
requires you to specify the name of a sequence object for the name parameter.
in ConnectionInterface at line 119
public DataFetcherInterface
getSingleDataFetcher($data $data)
in ConnectionInterface at line 126
public DataFetcherInterface
getDataFetcher($data $data)
at line 32
public int
exec(string $statement)
Execute an SQL statement and return the number of affected rows.
at line 53
public StatementInterface|bool
prepare(string $statement, array $driver_options = array())
Prepares a statement for execution and returns a statement object.
Prepares an SQL statement to be executed by the Statement::execute() method.
The SQL statement can contain zero or more named (:name) or question mark (?)
parameter markers for which real values will be substituted when the statement
is executed. You cannot use both named and question mark parameter markers
within the same SQL statement; pick one or the other parameter style. Use
these parameters to bind any user-input, do not include the user-input
directly in the query.
at line 64
public DataFetcherInterface
query(string $statement)
Executes an SQL statement, returning a result set as a Statement object.
at line 81
public string
quote(string $string, int $parameter_type = 2)
Quotes a string for use in a query.
Places quotes around the input string (if required) and escapes special
characters within the input string, using a quoting style appropriate to
the underlying driver.