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

The AMI_iTx interface

• Introduction

Transaction interface.

• Interface synopsis

AMI_iTx {
/* Constants */
const AMI_iTx::LOG_ERR =  3;
const AMI_iTx::LOG_NOTE =  1;
const AMI_iTx::LOG_WARN =  2;
/* Methods */
// Logs message to "_admin/_logs/tx.log".
public static log ( string $message, [ int $type = self::LOG_NOTE ] ) returns void;
// Add command executed on commit.
public addCommand ( string $cmd, [ mixed $data = null ] ) returns void;
// Adds command resources.
public addCommandResources ( $aResources ) returns void;
// Commit tracnsaction.
public commit ( ) returns void;
// Returns backup entity name or null.
public getBackupName ( string $entity, [ $oStorage = null ] ) returns string|null;
// Returns TRUE if transaction is started but not commited.
public isStarted ( ) returns bool;
// Revert (offline rollback) last tracnsaction.
public revert ( $aRollbackData, [ bool $output = TRUE ] ) returns void;
// Rollback tracnsaction.
public rollback ( ) returns void;
// Set backup entity name.
public setBackupName ( string $entity, string $name, [ $oStorage = null ] ) returns void;
// Set backup entity name.
public setExistence ( string $entity, bool $exists, [ $oStorage = null ] ) returns void;
// Start transaction.
public start ( strung $name ) returns void;
}
Tags:
since 6.0.2

• Interface Constants

LOG_ERR
LOG_NOTE
LOG_WARN

• Interface Methods

// Logs message to "_admin/_logs/tx.log".
public static log ( string $message, [ int $type = self::LOG_NOTE ] ) returns void;
  • string $message
    Message
  • int $type
    Type: self::LOG_NOTE / self::LOG_WARN / self::LOG_ERR
// Add command executed on commit.
public addCommand ( string $cmd, [ mixed $data = null ] ) returns void;
  • string $cmd
    Command
  • mixed $data
    Command data
// Adds command resources.
public addCommandResources ( $aResources ) returns void;
  • array $aResources
    Resources
// Commit tracnsaction.
public commit ( ) returns void;
// Returns backup entity name or null.
public getBackupName ( string $entity, [ $oStorage = null ] ) returns string|null;
  • string $entity
    Entity (file name, db table name, etc.)
  • AMI_iStorage $oStorage
    Storage object
// Returns TRUE if transaction is started but not commited.
public isStarted ( ) returns bool;
// Revert (offline rollback) last tracnsaction.
public revert ( $aRollbackData, [ bool $output = TRUE ] ) returns void;
  • array $aRollbackData
    Rollback data
  • bool $output
    Do output details
// Rollback tracnsaction.
public rollback ( ) returns void;
// Set backup entity name.
public setBackupName ( string $entity, string $name, [ $oStorage = null ] ) returns void;
  • string $entity
    Entity (file name, db table name, etc.)
  • string $name
    Backup entity name
  • AMI_iStorage $oStorage
    Storage object
// Set backup entity name.
public setExistence ( string $entity, bool $exists, [ $oStorage = null ] ) returns void;
  • string $entity
    Entity (file name, db table name, etc.)
  • bool $exists
    Flag specifying existence
  • AMI_iStorage $oStorage
    Storage object
// Start transaction.
public start ( strung $name ) returns void;
  • strung $name
    Transaction name