static mixed __callStatic(
string
$name, array
$arguments
)
|
|
Magic callstatic function
Parameters:
|
string |
$name: |
|
|
array |
$arguments: |
|
API Tags:
API Tags:
Redefinition of:
- atkDb::cloneAll()
- Clones the database structure of the given database to this database. This also means the complete database is emptied beforehand.
bool connect(
[string
$mode = 'rw']
)
|
|
Connects to a cluster node and sets the node as "current node"
Parameters:
|
string |
$mode: |
Mode can be r, w or rw |
API Tags:
| Return: | Whether the connect succeded or not |
| Access: | public |
Redefinition of:
- atkDb::connect()
- Connect to the database.
Creates a new new atkDDL based on current cluster nodes type
API Tags:
Redefinition of:
- atkDb::createDDL()
- Create an atkDDL object for constructing ddl queries.
Creates a new a new query object based on the current nodes type
API Tags:
Redefinition of:
- atkDb::createQuery()
- Create an atkQuery object for constructing queries.
void doConnect(
$host,
$user,
$password,
$database,
$port,
$charset
)
|
|
Parameters:
|
|
$host: |
|
|
|
$user: |
|
|
|
$password: |
|
|
|
$database: |
|
|
|
$port: |
|
|
|
$charset: |
|
API Tags:
Redefinition of:
- atkDb::doConnect()
- Connect to the database
API Tags:
Redefinition of:
- atkDb::escapeSQL()
- escapes quotes for use in SQL: ' -> '' (and sometimes % -> %%)
API Tags:
Redefinition of:
- atkDb::func_now()
- get NOW() or SYSDATE() equivalent for the current database
API Tags:
Redefinition of:
- atkDb::getDbStatus()
- Check if current db is present and acceptable for current user
API Tags:
Redefinition of:
- atkDb::getErrorMsg()
- Get localized error message (for display in the application)
API Tags:
Redefinition of:
- atkDb::getErrorType()
- Determine whether an error that occurred is a recoverable (user) error or a system error.
API Tags:
Redefinition of:
- atkDb::getrows()
- Get all rows that are the result of a certain specified query
API Tags:
Redefinition of:
- atkDb::getValue()
- Get a single value (first row, first column) from a certain specified query
API Tags:
Redefinition of:
- atkDb::getValues()
- Get an array with all the values in the (first) column.
API Tags:
Redefinition of:
- atkDb::halt()
- If haltonerror is set, this will raise an atkerror. If not, it will place the error in atkdebug and continue.
array hasMode(
string
$mode
)
|
|
Returns nodes that have a specific mode set
Parameters:
|
string |
$mode: |
Mode can be r, w or rw |
API Tags:
Redefinition of:
- atkDb::hasMode()
- Check if the current instance has the given mode
void init(
string
$connectionname, [string
$mode = 'rw']
)
|
|
Initialize the atkClusterDb
Parameters:
|
string |
$connectionname: |
The name of the database connection |
|
string |
$mode: |
Mode can be r, w or rw |
API Tags:
Redefinition of:
- atkDb::init()
- (Re)Initialise a database driver with a connection
API Tags:
Redefinition of:
- atkDb::lock()
- Lock a table in the database.
void maxIdentifierLength(
)
|
|
API Tags:
Redefinition of:
- atkDb::maxIdentifierLength()
- Returns the maximum length an identifier (tablename, columnname, etc) may have
API Tags:
Redefinition of:
- atkDb::metadata()
- Return the meta data of a certain table HIE GEBLEVEN
Gets the next available id
API Tags:
Redefinition of:
- atkDb::nextid()
- Get the next sequence number of a certain sequence.
Query method, first detects the query mode (read/write) and connects to the proper database before executing the query on it.
API Tags:
| Return: | Wether or not the query was executed successfully |
| Access: | public |
Redefinition of:
- atkDb::query()
- Parse and execute a query.
API Tags:
Redefinition of:
- atkDb::query_id()
- Get the current query statement resource id.
Sets config and mode for all configured nodes
API Tags:
void setCurrentClusterNode(
string
$mode
)
|
|
Sets a random cluster node as the current node based on the mode provided
Parameters:
API Tags:
API Tags:
Redefinition of:
- atkDb::setInstance()
- Replace the current instance of a named connection at runtime with a different connection. This is useful for example for replacing a named database instance with a mock object for testing purposes.
void setNodeConfig(
string
$nodename, array
$nodeconfig, string
$mode
)
|
|
Sets the config and mode for a named node
Parameters:
|
string |
$nodename: |
|
|
array |
$nodeconfig: |
|
|
string |
$mode: |
|
API Tags:
void setRandomNodeFromNodeConfigs(
array
$nodeconfigs, string
$mode
)
|
|
Selects a random node from the node configuration based on the mode.
Parameters:
|
array |
$nodeconfigs: |
|
|
string |
$mode: |
|
API Tags:
Because we extend atkDb __call won't be called for the atkDb public methods as they
are already implemented. We can't not-extend atkDb because this would break typehinting (people are using atkDb as typehints everywhere). The most decent way to fix this issue would be to make atkDb into an interface and then have atkClusterDb and atkDb implement it (and use 'atkDbInterface' for typehinting instead of atkDb), but this would break backward compatibility (maybe other people use atkDb in their code as well for typehinting) and since atkClusterDb doesn't seem to be used very often anyway for now we just solved this issue using some vogon poetry. Continue reading at your own risk.
API Tags:
Redefinition of:
- atkDb::setSequenceValue()
- Set database sequence value.
API Tags:
Redefinition of:
- atkDb::tableExists()
- This function checks the database for a table with the provide name
API Tags:
Redefinition of:
- atkDb::useMapping()
- Use the given mapping to translate database requests from one database to another database. This can be used for test purposes.
API Tags:
Redefinition of:
- atkDb::vendorDateFormat()
- Convert a php date() format specifier to a vendor specific format specifier.
API Tags:
Redefinition of:
- atkDb::_translateError()
- Translate database-vendor dependent error messages into an ATK generic error code.
mixed __call(
string
$name, array
$arguments
)
|
|
Magic call function
Parameters:
|
string |
$name: |
|
|
array |
$arguments: |
|
API Tags:
void __get(
string
$name
)
|
|
Gets a value from current nodes properties based on key
Parameters:
API Tags:
bool __isset(
string
$name
)
|
|
Checks if current node has the property set
Parameters:
API Tags:
void __set(
string
$name, mixed
$value
)
|
|
Allows setting key/value pairs for the current node
Parameters:
|
string |
$name: |
|
|
mixed |
$value: |
|
API Tags:
void __unset(
string
$name
)
|
|
Magic unset function
Parameters:
API Tags: