CmsDbResult - 2gathr/SimpleDB GitHub Wiki
CmsDbResult
A class allowing to retrieve the results of a call to CmsDb::query().
Overview
CmsDbResult {
public int lastInsertId ()
public int affectedRows ()
public CmsDbAdvResult confirm ()
public CmsDbAdvResult undo ()
public array getTokens ()
}
CmsDbResult::lastInsertId()
public int CmsDbResult::lastInsertId ()
Returns the ID of the last inserted row.
Return Values
Returns the row ID of the last row that was inserted into the database during the query related to the CmsDbAdvResult object if the query was an INSERT query.
CmsDbResult::affectedRows()
public int CmsDbResult::affectedRows ()
Returns the number of rows affected by the query related to the CmsDbResult object.
Return Values
Returns the number of rows that were modified or deleted by the SQL statement you issued if the query was an UPDATE or DELETE query. If no rows were affected, CmsDbResult::affectedRows() returns 0.
CmsDbResult::confirm()
public CmsDbResult CmsDbResult::confirm ()
Directly confirms the changes made by the query related to the CmsDbResult object.
Return Values
Returns the CmsDbResult object on success in order to allow method chaining.
CmsDbResult::undo()
public CmsDbResult CmsDbResult::undo ()
Directly reverts the changes made by the query related to the CmsDbResult object.
Return Values
Returns the CmsDbResult object on success in order to allow method chaining.
CmsDbResult::getTokens()
public array CmsDbResult::getTokens ()
Returns the tokens needed to later confirm or undo the changes made by the query related to the CmsDbResult object.
Return Values
Returns an array containing the following data:
array $tokens = (
'change_id' => int $id, //the ID of the executed change
'tokens' => array (
'confirm' => string $token_confirm, //the token needed to confirm the change
'undo' => string $token_undo //the token needed to undo the change
)
);