Amiro.CMS API Reference
Amiro.Ru / Manual
Loading search...

The AMI_Tx_Cmd_DB_Query class

AMI_Tx_Cmd
   |
   --AMI_Tx_Cmd_DB
      |
      --AMI_Tx_Cmd_DB_Query

• Introduction

Database query transaction command (no ability rollback, just commit).

• Class synopsis

AMI_Tx_Cmd_DB_Query extends AMI_Tx_Cmd_DB {
/* Inherited Properties */
// Array containing queries to rollback
protected AMI_Tx_Cmd_DB::$aRollback = array();
// DB object
protected AMI_Tx_Cmd_DB::$oDB;
// Flag specifying to replace original file on commit
// Backup name
// Command arguments
protected AMI_Tx_Cmd::$oArgs;
// Current transaction object
protected AMI_Tx_Cmd::$oTx;
/* Methods */
// Commits command.
public commit ( ) returns void;
// Runs command.
protected run ( ) returns void;
// Validates passed arguments.
protected validateArgs ( ) returns void;
/* Inherited Methods */
// Adds resources of available commands.
public static AMI_Tx_Cmd_DB::addResources ( ) returns void;
// Rollbacks command.
public AMI_Tx_Cmd_DB::rollback ( ) returns void;
// Executes db query.
protected AMI_Tx_Cmd_DB::execSQL ( string $sql, int $type, [ int $flags = 0 ] ) returns void;
// Initializes command.
protected AMI_Tx_Cmd_DB::init ( ) returns void;
// Validates passed arguments.
protected AMI_Tx_Cmd_DB::validateArgs ( ) returns void;
// Constructor.
public AMI_Tx_Cmd::__construct ( $oTx, AMI_Tx_Cmd_Args $oArgs ) returns AMI_Tx_Cmd;
// Returns string containing argements for logging.
public AMI_Tx_Cmd::getLoggingArgs ( ) returns string;
// Returns string containing specifying arguments and values.
protected AMI_Tx_Cmd::argsToString ( [ $aArgs = array() ] ) returns string;
// Initializes command.
protected AMI_Tx_Cmd::init ( ) returns void;
// Runs command.
protected AMI_Tx_Cmd::run ( ) returns void;
// Validates passed arguments.
protected AMI_Tx_Cmd::validateArgs ( ) returns void;
// Validates obligatory arguments.
protected AMI_Tx_Cmd::validateObligatoryArgs ( $aArgs ) returns void;
}

• Class Details

Expects in $oArgs constructor arguments:
  • query - array of queries.
Example:
  •  $this->aTx['db']->addCommand(
  •      'query',
  •      new AMI_Tx_Cmd_Args(
  •          array(
  •              'aQueries' => array(...)
  •          )
  •      )
  •  );
Tags:
resource tx/cmd/db/query AMI::getResource('tx/cmd/db/query')
since 6.0.2

• Class Methods

// Commits command.
public commit ( ) returns void;
// Runs command.
protected run ( ) returns void;

Overrides: AMI_Tx_Cmd::run().

// Validates passed arguments.
protected validateArgs ( ) returns void;