Action
Action
Represents a migration action, encapsulating its type, name, message, and specification.
class Action extends \Hazaar\Model\StructExtends: Hazaar\Model\Struct
Handles construction, validation, and execution of migration actions, including special handling for raise and drop actions.
Properties
name
The name of the migration action (e.g., CREATE, DROP, RAISE).
public ActionName $nameType: Hazaar\DBI\Manager\Migration\Enum\ActionName
type
The type of the migration action (e.g., TABLE, INDEX, EXTENSION).
public ActionType $typeType: Hazaar\DBI\Manager\Migration\Enum\ActionType
message
The message associated with the action, if any.
public string $messageType: string
spec
The specification object for the action, containing detailed logic.
public BaseAction $specType: Hazaar\DBI\Manager\Migration\Action\BaseAction
Methods
construct
Initializes the action from the provided data.
public construct(mixed $data): voidReturns: void
Handles special cases for raise, warn, and notice actions, and validates required fields.
Parameters
| Parameter | Type | Description |
|---|---|---|
$data | mixed | The data to initialize the action from. Modified by reference. |
run
public run(Adapter $dbi, ?string $user): boolReturns: bool
Parameters
| Parameter | Type | Description |
|---|---|---|
$dbi | Hazaar\DBI\Adapter | |
$user | string |
create
public create(ActionType $type, mixed $spec): selfReturns: self
Parameters
| Parameter | Type | Description |
|---|---|---|
$type | Hazaar\DBI\Manager\Migration\Enum\ActionType | |
$spec | mixed |
constructed
protected constructed(): voidReturns: void
Generated by Hazaar API Doc Generator on Fri, 04 Sep 2026 23:32:16 +0000