Func
Func
Represents a database function for migration actions.
class Func extends \Hazaar\DBI\Manager\Migration\Action\BaseActionEncapsulates function attributes such as name, return type, parameters, language, and body. Provides methods for creating, altering, dropping, applying, and diffing functions in migration processes.
Properties
name
The name of the function.
public string $namereturnType
The return type of the function.
public string $returnTypeparams
The parameters of the function.
public array $paramslang
The language of the function implementation (e.g., SQL, PLPGSQL).
public string $langbody
The body of the function.
public string $bodyMethods
create
Creates the function in the database.
public create(Adapter $dbi): boolThrows an exception if the function body is not set.
Parameters
| Parameter | Type | Description |
|---|---|---|
$dbi | Adapter | the database adapter instance |
alter
Alters the function in the database.
public alter(Adapter $dbi): boolParameters
| Parameter | Type | Description |
|---|---|---|
$dbi | Adapter | the database adapter instance |
drop
Drops the function from the database.
public drop(Adapter $dbi): boolParameters
| Parameter | Type | Description |
|---|---|---|
$dbi | Adapter | the database adapter instance |
apply
Applies changes from another function action to this one.
public apply(BaseAction $action): boolUpdates the function body if the provided action is an instance of this class.
Parameters
| Parameter | Type | Description |
|---|---|---|
$action | BaseAction | the action to apply changes from |
diff
Finds the difference between this function and another action.
public diff(BaseAction $action): ?BaseActionReturns the other action if the function bodies differ, otherwise null.
Parameters
| Parameter | Type | Description |
|---|---|---|
$action | BaseAction | the action to compare against |
Generated by Hazaar API Doc Generator on Tue, 21 Apr 2026 04:00:24 +0000