0 follower

Trait yii\db\ViewFinderTrait

Implemented byyii\db\mssql\Schema, yii\db\pgsql\Schema
Available since version2.0.12
Source Code https://github.com/yiisoft/yii2/blob/master/framework/db/ViewFinderTrait.php

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

Public Methods

Hide inherited methods

Method Description Defined By
getViewNames() Returns all view names in the database. yii\db\ViewFinderTrait

Protected Methods

Hide inherited methods

Method Description Defined By
findViewNames() Returns all views names in the database. yii\db\ViewFinderTrait

Method Details

Hide inherited methods

findViewNames() protected abstract method

Returns all views names in the database.

protected abstract array findViewNames ( $schema '' )
$schema string

The schema of the views. Defaults to empty string, meaning the current or default schema.

return array

All views names in the database. The names have NO schema name prefix.

                abstract protected function findViewNames($schema = '');

            
getViewNames() public method

Returns all view names in the database.

public string[] getViewNames ( $schema '', $refresh false )
$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 boolean

Whether to fetch the latest available view names. If this is false, view names fetched previously (if available) will be returned.

return string[]

All view names in the database.

                public function getViewNames($schema = '', $refresh = false)
{
    if (!isset($this->_viewNames[$schema]) || $refresh) {
        $this->_viewNames[$schema] = $this->findViewNames($schema);
    }
    return $this->_viewNames[$schema];
}