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

The AMI_Tx_Cmd_DB_CreateTable class

AMI_Tx_Cmd
   |
   --AMI_Tx_Cmd_DB
      |
      --AMI_Tx_Cmd_DB_CreateTable

• Introduction

Database "CREATE TABLE" transaction command.

• Class synopsis

AMI_Tx_Cmd_DB_CreateTable extends AMI_Tx_Cmd_DB {
/* Properties */
// Flag specifies if previous db table was backuped
protected bool $backuped = FALSE;
/* 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:
  • mode - command execustion mode (AMI_iTx_Cmd::MODE_* constants);
  • source - "CREATE TABLE" query,
  • target - table name.
Example:
  •  $this->aTx['db']->addCommand(
  •      'table/create',
  •      new AMI_Tx_Cmd_Args(
  •          array(
  •              'mode'   => $this->oArgs->mode,
  •              'source' => $sql,
  •              'target' => $table
  •          )
  •      )
  •  );
Tags:
resource tx/cmd/db/table/create AMI::getResource('tx/cmd/db/table/create')
since 6.0.2

• Class Properies

protected bool $backuped

Flag specifies if previous db table was backuped

• Class Methods

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

Overrides: AMI_Tx_Cmd::run().

Tags:
throws AMI_Tx_Exception In case of problems.
// Validates passed arguments.
protected validateArgs ( ) returns void;