Methods

All methods in the Solar_Sql_Adapter_MysqlReplicated class.

Public

__construct()

Constructor.

__destruct()

Default destructor; does nothing other than provide a safe fallback for calls to parent::__destruct().

addColumn()

Adds a portable column to a table in the database.

begin()

Leave autocommit mode and begin a transaction on the master.

commit()

Commit a transaction and return to autocommit mode on the master.

connect()

Connects to a random slave server.

connectMaster()

Connects to the master server.

createIndex()

Creates a portable index on a table.

createSequence()

Creates a sequence in the database.

createTable()

Creates a portable table.

delete()

Deletes rows from the table based on a WHERE clause.

disconnect()

Disconnects from the master and the slave.

dropColumn()

Drops a column from a table in the database.

dropIndex()

Drops an index from a table in the database.

dropSequence()

Drops a sequence from the database.

dropTable()

Drops a table from the database, if it exists.

dump()

Convenience method for getting a dump the whole object, or one of its properties, or an external variable.

fetchAll()

Fetches all rows from the database using sequential keys.

fetchAssoc()

Fetches all rows from the database using associative keys (defined by the first column).

fetchCol()

Fetches the first column of all rows as a sequential array.

fetchIndexInfo()

Returns an array describing table indexes from the cache; if the cache entry is not available, queries the database for the index information.

fetchOne()

Fetches one row from the database.

fetchPairs()

Fetches an associative array of all rows as key-value pairs (first column is the key, second column is the value).

fetchPdo()

Fetches a PDOStatement result object.

fetchSql()

Builds the SQL statement and returns it as a string instead of executing it.

fetchTableCols()

Returns an array describing table columns from the cache; if the cache entry is not available, queries the database for the column descriptions.

fetchTableList()

Returns a list of database tables from the cache; if the cache entry is not available, queries the database for the list of tables.

fetchValue()

Fetches the very first value (i.e., first column of the first row).

getCache()

Returns the cache object.

getCacheKeyPrefix()

Gets the connection-specific cache key prefix.

getPdo()

Get the PDO connection object (connects to the database if needed).

getPdoMaster()

Get the master PDO connection object (connects to the database if needed).

getProfile()

Get the query profile array.

insert()

Inserts a row of data into a table.

lastInsertId()

Get the last auto-incremented insert ID from the database.

locale()

Looks up class-specific locale strings based on a key.

nextSequence()

Gets the next number in a sequence; creates the sequence if it does not exist.

query()

Prepares and executes an SQL statement, optionally binding values to named parameters in the statement.

quote()

Safely quotes a value for an SQL statement.

quoteInto()

Quotes a value and places into a piece of text at a placeholder; the placeholder is a question-mark.

quoteMulti()

Quote multiple text-and-value pieces.

quoteName()

Quotes a single identifier name (table, table alias, table column, index, sequence).

quoteNamesIn()

Quotes all fully-qualified identifier names ("table.col") in a string, typically an SQL snippet for a SELECT clause.

rollback()

Roll back a transaction and return to autocommit mode on the master.

setCache()

Injects a cache dependency for $_cache.

setCacheKeyPrefix()

Sets the connection-specific cache key prefix.

setProfiling()

Turns profiling on and off.

update()

Updates a table with specified data based on a WHERE clause.

Protected

_addProfile()

Adds an element to the profile array.

_bind()

Binds an array of scalars as values into a prepared PDOStatment.

_buildConfig()

Builds and returns the default config for a class, including all configs inherited from its parents.

_buildDsn()

Creates a PDO-style DSN.

_checkIdentifier()

Check if a table, index, or column name is a valid portable identifier.

_checkIdentifierColumn()

Checks a column name.

_checkIdentifierPart()

Checks one part of a dotted identifier (schema.table, database.table, etc).

_createSequence()

Creates a sequence, optionally starting at a certain number.

_dropIndex()

Drops an index.

_dropSequence()

Drops a sequence.

_exception()

Convenience method for returning exceptions with localized text.

_fetchIndexInfo()

Returns an array of index information for a table.

_fetchTableCols()

Returns an array describing the columns in a table.

_fetchTableList()

Returns a list of all tables in the database.

_getCacheKey()

Gets a full cache key.

_getDefault()

Given a native column SQL default value, finds a PHP literal value.

_getTypeSizeScope()

Given a column specification, parse into datatype, size, and decimal scope.

_modAutoincPrimary()

Given a column definition, modifies the auto-increment and primary-key clauses in place.

_modIndexName()

Modifies an index name for adapters.

_modSelect()

Modifies a SELECT statement in place to add a LIMIT clause.

_modSequenceName()

Modifies the sequence name.

_nextSequence()

Gets a sequence number; creates the sequence if it does not exist.

_postConfig()

A hook that activates after _buildConfig() in the constructor.

_postConnect()

After connection, set various connection attributes.

_postConnectMaster()

Force the master connection to use the same attributes as the slave.

_postConstruct()

Post-construction tasks to complete object construction.

_preConfig()

A hook that activates before _buildConfig() in the constructor.

_prepare()

Prepares an SQL query as a PDOStatement object, using the slave PDO connection for all SELECT queries outside a transation, and the master PDO connection for all other queries (incl.

_quoteName()

Quotes an identifier name (table, index, etc); ignores empty values and values of '*'.

_quoteNamesIn()

Quotes all fully-qualified identifier names ("table.col") in a string.

_select()

Returns a SELECT statement built from its component parts.

_selectCompound()

Builds a compound SELECT command string from its component parts, without the LIMIT portions; those are left to the individual adapters.

_selectSingle()

Builds a single SELECT command string from its component parts, without the LIMIT portions; those are left to the individual adapters.

_selectSingleFrom()

Builds the FROM clause for a SELECT command; wraps it in parentheses to force precedence for MySQL.

_setDsn()

Sets the DSN for the slave and the master; the slave is picked at random from the list of slaves.

_setup()

Follow-on setup for the constructor to build the $_slaves array.

_splitSchemaIdent()

Splits a schema.table identifier into its component parts.

_sqlColdef()

Returns a column definition string.

_sqlCreateTable()

Builds a CREATE TABLE command string.

Private

None.



Local