Trigger
Trigger
Represents a database trigger for migration actions.
class Trigger extends \Hazaar\DBI\Manager\Migration\Action\BaseActionExtends: Hazaar\DBI\Manager\Migration\Action\BaseAction
Encapsulates trigger attributes such as name, table, events, timing, orientation, and body. Provides methods for creating, altering, and dropping triggers in migration processes.
Properties
name
The name of the trigger.
public string $nameType: string
table
The name of the table the trigger applies to.
public string $tableType: string
events
The events that fire the trigger (e.g., INSERT, UPDATE, DELETE).
public array $eventsType: array
timing
The timing of the trigger (e.g., BEFORE, AFTER).
public string $timingType: string
orientation
The orientation of the trigger (e.g., ROW, STATEMENT).
public string $orientationType: string
body
The body of the trigger (the code to execute).
public string $bodyType: string
Methods
create
Creates the trigger in the database.
public create(Adapter $dbi, ?string $user): boolReturns: bool
Parameters
| Parameter | Type | Description |
|---|---|---|
$dbi | Hazaar\DBI\Adapter | the database adapter instance |
$user | string | not used for triggers, but included for consistency with other actions |
alter
Alters the trigger in the database.
public alter(Adapter $dbi): boolReturns: bool
Parameters
| Parameter | Type | Description |
|---|---|---|
$dbi | Hazaar\DBI\Adapter | the database adapter instance |
drop
Drops the trigger from the database.
public drop(Adapter $dbi): boolReturns: bool
Parameters
| Parameter | Type | Description |
|---|---|---|
$dbi | Hazaar\DBI\Adapter | the database adapter instance |
Generated by Hazaar API Doc Generator on Fri, 04 Sep 2026 23:32:16 +0000