0 追蹤者

Trait yii\db\ViewFinderTrait

實作於yii\db\mssql\Schema, yii\db\pgsql\Schema
自版本起可用2.0.12
原始碼 https://github.com/yiisoft/yii2/blob/master/framework/db/ViewFinderTrait.php

ViewFinderTrait 實作了 getViewNames 方法,用於在資料庫中尋找視圖。

公有方法

隱藏繼承的方法

方法 描述 定義於
getViewNames() 傳回資料庫中所有視圖名稱。 yii\db\ViewFinderTrait

保護方法

隱藏繼承的方法

方法 描述 定義於
findViewNames() 傳回資料庫中所有視圖名稱。 yii\db\ViewFinderTrait

方法詳情

隱藏繼承的方法

findViewNames() protected abstract method

傳回資料庫中所有視圖名稱。

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

視圖的 Schema。預設為空字串,表示目前的或預設的 Schema。

return array

資料庫中所有視圖名稱。名稱不帶 Schema 名稱前綴。

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

            
getViewNames() public method

傳回資料庫中所有視圖名稱。

public string[] getViewNames ( $schema '', $refresh false )
$schema string

視圖的 Schema。預設為空字串,表示目前的或預設的 Schema 名稱。若不為空,傳回的視圖名稱將會帶有 Schema 名稱前綴。

$refresh boolean

是否獲取最新的可用視圖名稱。若為 false,將傳回先前獲取的視圖名稱(如果有的話)。

return string[]

資料庫中所有視圖名稱。

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