ViewFinderTrait
API reference › yii › db › ViewFinderTrait
Used by 2 types
ViewFinderTrait implements the method getViewNames for finding views in a database.
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
getViewNames() | Returns all view names in the database. | ViewFinderTrait |
findViewNames() protected abstract | Returns all views names in the database. | ViewFinderTrait |
Method details
Section titled “Method details”getViewNames()
Section titled “getViewNames() ”public function getViewNames(string $schema = '', bool $refresh = false): string[]Returns all view names in the database.
Parameters
| Parameter | Type | Description |
|---|---|---|
$schema | string | The schema of the views. Defaults to empty string, meaning the current or default schema name. If not empty, the returned view names will be prefixed with the schema name. |
$refresh | bool | Whether to fetch the latest available view names. If this is false, view names fetched previously (if available) will be returned. |
Returns
string[]: All view names in the database.
findViewNames()
Section titled “findViewNames() ”abstract protected function findViewNames(string $schema = ''): arrayReturns all views names in the database.
Parameters
| Parameter | Type | Description |
|---|---|---|
$schema | string | The schema of the views. Defaults to empty string, meaning the current or default schema. |
Returns
array: All views names in the database. The names have NO schema name prefix.