Skip to content
PHP Ecosystem
Explore

ViewFinderTrait

API reference › yii › db › ViewFinderTrait

traityii\db\ViewFinderTrait
Since2.0.12
Sourceframework/db/ViewFinderTrait.php
Used by 2 types

ViewFinderTrait implements the method getViewNames for finding views in a database.

MethodDescriptionDefined by
getViewNames()Returns all view names in the database.ViewFinderTrait
findViewNames() protected abstractReturns all views names in the database.ViewFinderTrait
public function getViewNames(string $schema = '', bool $refresh = false): string[]

Returns all view names in the database.

Parameters

ParameterTypeDescription
$schemastringThe 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.
$refreshboolWhether 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.

abstract protected function findViewNames(string $schema = ''): array

Returns all views names in the database.

Parameters

ParameterTypeDescription
$schemastringThe 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.