Raise
Less than 1 minute
Raise
Represents a migration action that raises an error, warning, or notice.
class Raise extends \Hazaar\DBI\Manager\Migration\Action\BaseActionExtends: Hazaar\DBI\Manager\Migration\Action\BaseAction
Used to trigger exceptions or log messages during migration processes.
Properties
message
The message to raise or log during the migration action.
public string $messageType: string
Methods
construct
Initializes the raise action from the provided data.
public construct(mixed $data): voidReturns: void
Sets the message based on the 'raise', 'warn', or 'notice' keys in the data.
Parameters
| Parameter | Type | Description |
|---|---|---|
$data | mixed | The data to initialize the message from. Modified by reference. |
run
Executes the raise action, throwing an exception or logging a message.
public run(Adapter $dbi, ActionType $type, ActionName $name, ?string $user): boolReturns: bool
Throws an exception if the action type is ERROR, otherwise logs the message.
Parameters
| Parameter | Type | Description |
|---|---|---|
$dbi | Hazaar\DBI\Adapter | the database adapter instance |
$type | Hazaar\DBI\Manager\Migration\Enum\ActionType | The type of migration action (ERROR, WARN, NOTICE, etc.). |
$name | Hazaar\DBI\Manager\Migration\Enum\ActionName | the name of the migration action |
$user | string | not used for raise actions, but included for consistency with other actions |
Generated by Hazaar API Doc Generator on Fri, 04 Sep 2026 23:32:16 +0000