View
View
Represents a database view for migration actions.
class View extends \Hazaar\DBI\Manager\Migration\Action\BaseActionExtends: Hazaar\DBI\Manager\Migration\Action\BaseAction
Encapsulates 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 $nameType: string
body
The SQL body of the view definition.
public string $bodyType: string
dropFirst
Whether to drop the view before altering it.
public bool $dropFirstType: bool
Methods
create
Creates the view in the database.
public create(Adapter $dbi, ?string $user): boolReturns: bool
Throws an exception if the view body is not set.
Parameters
| Parameter | Type | Description |
|---|---|---|
$dbi | Hazaar\DBI\Adapter | the database adapter instance |
$user | string | user to grant permissions to |
alter
public alter(Adapter $dbi): boolReturns: bool
Parameters
| Parameter | Type | Description |
|---|---|---|
$dbi | Hazaar\DBI\Adapter |
drop
public drop(Adapter $dbi): boolReturns: bool
Parameters
| Parameter | Type | Description |
|---|---|---|
$dbi | Hazaar\DBI\Adapter |
apply
Apply an ALTER action to the BaseAction.
public apply(BaseAction $action): boolReturns: bool
Parameters
| Parameter | Type | Description |
|---|---|---|
$action | Hazaar\DBI\Manager\Migration\Action\BaseAction |
diff
Find the difference between two BaseActions.
public diff(BaseAction $action): ?BaseActionReturns: Hazaar\DBI\Manager\Migration\Action\BaseAction
Parameters
| Parameter | Type | Description |
|---|---|---|
$action | Hazaar\DBI\Manager\Migration\Action\BaseAction |
Generated by Hazaar API Doc Generator on Fri, 04 Sep 2026 23:32:16 +0000