CreateTransactionOperation
extends TransactionOperation
in package
The CreateTransactionOperation class
Transaction operation to create objects into DBMS
Tags
Table of Contents
Properties
- $class : PermanentEntity>
- The class of this operation
- $data : array<string|int, mixed>
- The data to insert
- $fields : array<string|int, string>
- Fields to restrict creation
- $insertId : string|null
- The resulting ID after inserted data
- $isValid : bool
- If this Operation is valid
- $sqlAdapter : AbstractSqlAdapter|null
- The SQL Adapter
- $transactionOperationSet : TransactionOperationSet|null
- The transaction set
Methods
- __construct() : mixed
- Constructor
- getInsertId() : string|null
- Get the last inserted data's id
- getSqlAdapter() : AbstractSqlAdapter|null
- Get the SQL Adapter
- getTransactionOperationSet() : TransactionOperationSet
- Get the TransactionOperationSet
- isValid() : bool
- If this operation is valid
- run() : string|false
- Run this operation
- runIfValid() : mixed
- Run this operation only if valid
- setSqlAdapter() : static
- Set the SQL Adapter
- setTransactionOperationSet() : static
- Set the TransactionOperationSet
- validate() : void
- Validate this operation
- setIsValid() : static
- Set this operation validity
Properties
$class
The class of this operation
protected
PermanentEntity>
$class
$data
The data to insert
protected
array<string|int, mixed>
$data
$fields
Fields to restrict creation
protected
array<string|int, string>
$fields
$insertId
The resulting ID after inserted data
protected
string|null
$insertId
= null
$isValid
If this Operation is valid
protected
bool
$isValid
= false
$sqlAdapter
The SQL Adapter
protected
AbstractSqlAdapter|null
$sqlAdapter
= null
$transactionOperationSet
The transaction set
protected
TransactionOperationSet|null
$transactionOperationSet
Methods
__construct()
Constructor
public
__construct(string $class, array<string|int, mixed> $data, array<string|int, mixed>|null $fields) : mixed
Parameters
- $class : string
- $data : array<string|int, mixed>
- $fields : array<string|int, mixed>|null
getInsertId()
Get the last inserted data's id
public
getInsertId() : string|null
Return values
string|nullgetSqlAdapter()
Get the SQL Adapter
public
getSqlAdapter() : AbstractSqlAdapter|null
Return values
AbstractSqlAdapter|nullgetTransactionOperationSet()
Get the TransactionOperationSet
public
getTransactionOperationSet() : TransactionOperationSet
Return values
TransactionOperationSetisValid()
If this operation is valid
public
isValid() : bool
Return values
boolrun()
Run this operation
public
run() : string|false
Return values
string|falserunIfValid()
Run this operation only if valid
public
runIfValid() : mixed
setSqlAdapter()
Set the SQL Adapter
public
setSqlAdapter(AbstractSqlAdapter $sqlAdapter) : static
Parameters
- $sqlAdapter : AbstractSqlAdapter
Return values
staticsetTransactionOperationSet()
Set the TransactionOperationSet
public
setTransactionOperationSet(TransactionOperationSet $transactionOperationSet) : static
Parameters
- $transactionOperationSet : TransactionOperationSet
Return values
staticvalidate()
Validate this operation
public
validate([int &$errors = 0 ]) : void
Parameters
- $errors : int = 0
Tags
setIsValid()
Set this operation validity
protected
setIsValid(bool $valid) : static
Parameters
- $valid : bool