db\Connection getSlavePdo()

getSlavePdo() public method

Returns the PDO instance for the currently active slave connection.

When $enableSlaves is true, one of the slaves will be used for read queries, and its PDO instance will be returned by this method.

public PDO getSlavePdo ( $fallbackToMaster = true )
$fallbackToMaster boolean

Whether to return a master PDO in case none of the slave connections is available.

return PDO

The PDO instance for the currently active slave connection. Null is returned if no slave connection is available and $fallbackToMaster is false.

doc_Yii
2016-10-30 16:57:48
Comments
Leave a Comment

Please login to continue.