View
Less than 1 minute
View
Represents a database view for migration actions.
class View extends \Hazaar\DBI\Manager\Migration\Action\BaseActionEncapsulates view attributes such as name, body, and dropFirst flag. Provides methods for creating, altering, dropping, applying, and diffing views in migration processes.
Properties
name
The name of the view.
public string $namebody
The SQL body of the view definition.
public string $bodydropFirst
Whether to drop the view before altering it.
public bool $dropFirstMethods
create
Creates the view in the database.
public create(Adapter $dbi): boolThrows an exception if the view body is not set.
Parameters
| Parameter | Type | Description |
|---|---|---|
$dbi | Adapter | the database adapter instance |
alter
public alter(Adapter $dbi): boolParameters
| Parameter | Type | Description |
|---|---|---|
$dbi | Adapter |
drop
public drop(Adapter $dbi): boolParameters
| Parameter | Type | Description |
|---|---|---|
$dbi | Adapter |
apply
Apply an ALTER action to the BaseAction.
public apply(BaseAction $action): boolParameters
| Parameter | Type | Description |
|---|---|---|
$action | BaseAction |
diff
Find the difference between two BaseActions.
public diff(BaseAction $action): ?BaseActionParameters
| Parameter | Type | Description |
|---|---|---|
$action | BaseAction |
Generated by Hazaar API Doc Generator on Tue, 21 Apr 2026 04:00:24 +0000