메소드 |
설명 |
|
__call ( string $method, array $args ) |
Delegate unknown methods to the _write adapter. |
|
__construct ( Horde_Db_Adapter $read, Horde_Db_Adapter $write ) |
Const'r |
|
adapterName ( ) : string |
Returns the human-readable name of the adapter. Use mixed case - one
can always use downcase if needed. |
|
addLimitOffset ( string $sql, array $options ) : string |
Appends +LIMIT+ and +OFFSET+ options to a SQL statement. |
|
addLock ( &$sql, array $options = [] ) |
Appends a locking clause to an SQL statement. |
|
beginDbTransaction ( ) |
Begins the transaction (and turns off auto-committing). |
|
commitDbTransaction ( ) |
Commits the transaction (and turns on auto-committing). |
|
connect ( ) |
Connect to the db. |
|
delete ( string $sql, mixed $arg1 = null, string $arg2 = null ) : integer |
Executes the delete statement and returns the number of rows affected. |
|
disconnect ( ) |
Disconnect from db. |
|
execute ( string $sql, mixed $arg1 = null, string $arg2 = null ) : PDOStatement |
Executes the SQL statement in the context of this connection. |
|
insert ( string $sql, mixed $arg1 = null, string $arg2 = null, string $pk = null, integer $idValue = null, string $sequenceName = null ) : integer |
Returns the last auto-generated ID from the affected table. |
|
insertBlob ( string $table, array $fields, string $pk = null, integer $idValue = null ) : integer |
Inserts a row including BLOBs into a table. |
|
isActive ( ) : boolean |
Is the connection active? |
|
prefetchPrimaryKey ( $tableName = null ) : boolean |
Should primary key values be selected from their corresponding
sequence before the insert statement? If true, next_sequence_value
is called before each insert to set the record's primary key. |
|
quoteString ( string $string ) : string |
Quotes a string, escaping any special characters. |
|
rawConnection ( ) : resource |
Provides access to the underlying database connection. Useful for when
you need to call a proprietary method such as postgresql's
lo_* methods. |
|
reconnect ( ) |
Reconnect to the db. |
|
rollbackDbTransaction ( ) |
Rolls back the transaction (and turns on auto-committing). Must be
done if the transaction block raises an exception or returns false. |
|
select ( string $sql, mixed $arg1 = null, string $arg2 = null ) : PDOStatement |
Returns an array of records with the column names as keys, and
column values as values. |
|
selectAll ( string $sql, mixed $arg1 = null, string $arg2 = null ) : array |
Returns an array of record hashes with the column names as keys and
column values as values. |
|
selectAssoc ( string $sql, mixed $arg1 = null, string $arg2 = null ) : array |
Returns an array where the keys are the first column of a select, and the
values are the second column: |
|
selectOne ( string $sql, mixed $arg1 = null, string $arg2 = null ) : array |
Returns a record hash with the column names as keys and column values
as values. |
|
selectValue ( string $sql, mixed $arg1 = null, string $arg2 = null ) : string |
Returns a single value from a record |
|
selectValues ( string $sql, mixed $arg1 = null, string $arg2 = null ) : array |
Returns an array of the values of the first column in a select:
selectValues("SELECT id FROM companies LIMIT 3") => [1,2,3] |
|
supportsCountDistinct ( ) : boolean |
Does this adapter support using DISTINCT within COUNT? This is +true+
for all adapters except sqlite. |
|
supportsMigrations ( ) : boolean |
Does this adapter support migrations? |
|
transactionStarted ( ) : boolean |
Check if a transaction has been started. |
|
update ( string $sql, mixed $arg1 = null, string $arg2 = null ) : integer |
Executes the update statement and returns the number of rows affected. |
|
updateBlob ( string $table, array $fields, string $where = '' ) |
Updates rows including BLOBs into a table. |
|