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
checkSpecKeys
Rejects keys a spec doesn't support, which would otherwise be dropped without a word.
private checkSpecKeys(ActionType $type, ActionName $name, array $spec): voidReturns: void
Only object-shaped specs of the schema object types are checked. A list (such as a drop list) and the other action types, whose specs take shorthand forms, are left to their own spec classes.
Parameters
| Parameter | Type | Description |
|---|---|---|
$type | Hazaar\DBI\Manager\Migration\Enum\ActionType | |
$name | Hazaar\DBI\Manager\Migration\Enum\ActionName | |
$spec | array |
rejectUnknownKeys
private rejectUnknownKeys(string $class, array $data, string $label): voidReturns: void
Parameters
| Parameter | Type | Description |
|---|---|---|
$class | string | |
$data | array | |
$label | string |
quotedName
private quotedName(array $spec): stringReturns: string
Parameters
| Parameter | Type | Description |
|---|---|---|
$spec | array |
publicProperties
private publicProperties(string $class): arrayReturns: array
Parameters
| Parameter | Type | Description |
|---|---|---|
$class | string |
Generated by Hazaar API Doc Generator on Sun, 08 Nov 2026 03:36:14 +0000