0 フォロワー

クラス yii\db\mssql\ColumnSchemaBuilder

継承yii\db\mssql\ColumnSchemaBuilder » yii\db\ColumnSchemaBuilder » yii\base\BaseObject
実装yii\base\Configurable
利用可能なバージョン2.0.42
ソースコード https://github.com/yiisoft/yii2/blob/master/framework/db/mssql/ColumnSchemaBuilder.php

ColumnSchemaBuilderは、MSSQLデータベースのスキーマビルダーです。

公開プロパティ

継承されたプロパティを非表示

プロパティ 説明 定義元
$after string この列の後に追加される列。 yii\db\ColumnSchemaBuilder
$append mixed 列スキーマ定義に付加されるSQL文字列。 yii\db\ColumnSchemaBuilder
$categoryMap array 抽象的な列の種類(キー)から種類カテゴリ(値)へのマッピング。 yii\db\ColumnSchemaBuilder
$check string 列のCHECK制約。 yii\db\ColumnSchemaBuilder
$checkValue string|null 列のCHECK制約。 yii\db\mssql\ColumnSchemaBuilder
$comment string 列のコメント値。 yii\db\ColumnSchemaBuilder
$db yii\db\Connection 現在のデータベース接続。 yii\db\ColumnSchemaBuilder
$default mixed 列のデフォルト値。 yii\db\ColumnSchemaBuilder
$defaultValue string|yii\db\Expression|null 列のデフォルト値。 yii\db\mssql\ColumnSchemaBuilder
$format yii\db\mssql\ColumnSchemaBuilder
$isFirst boolean この列がテーブルの先頭に挿入されるかどうか。 yii\db\ColumnSchemaBuilder
$isNotNull boolean|null 列がNULL許容かどうか。 yii\db\ColumnSchemaBuilder
$isUnique boolean 列の値を一意にする必要があるかどうか。 yii\db\ColumnSchemaBuilder
$isUnsigned boolean 列の値を符号なしにする必要があるかどうか。 yii\db\ColumnSchemaBuilder
$length integer|string|array 列のサイズまたは精度の定義。 yii\db\ColumnSchemaBuilder
$type string 列の種類定義(INTEGER、VARCHAR、DATETIMEなど)。 yii\db\ColumnSchemaBuilder
$typeCategoryMap array 抽象的な列の種類(キー)から種類カテゴリ(値)へのマッピング。 yii\db\ColumnSchemaBuilder

保護されたプロパティ

継承されたプロパティを非表示

プロパティ 説明 定義元

公開メソッド

継承されたメソッドを非表示

メソッド 説明 定義元
__call() クラスメソッドではない名前付きメソッドを呼び出します。 yii\base\BaseObject
__construct() 型と値の精度を指定して、列スキーマビルダーインスタンスを作成します。 yii\db\ColumnSchemaBuilder
__get() オブジェクトプロパティの値を返します。 yii\base\BaseObject
__isset() プロパティが設定されているかどうか(定義されていてNULLでない)を確認します。 yii\base\BaseObject
__set() オブジェクトプロパティの値を設定します。 yii\base\BaseObject
__toString() 列のスキーマの完全な文字列を構築します。 yii\db\mssql\ColumnSchemaBuilder
__unset() オブジェクトプロパティをNULLに設定します。 yii\base\BaseObject
after() 列にAFTER制約を追加します。 yii\db\ColumnSchemaBuilder
append() 列定義に付加する追加のSQLを指定します。 yii\db\ColumnSchemaBuilder
canGetProperty() プロパティを読み取ることができるかどうかを示す値を返します。 yii\base\BaseObject
canSetProperty() プロパティを設定できるかどうかを示す値を返します。 yii\base\BaseObject
check() 列のCHECK制約を設定します。 yii\db\ColumnSchemaBuilder
className() このクラスの完全修飾名を返します。 yii\base\BaseObject
comment() 列のコメントを指定します。 yii\db\ColumnSchemaBuilder
defaultExpression() 列のデフォルトSQL式を指定します。 yii\db\ColumnSchemaBuilder
defaultValue() 列のデフォルト値を指定します。 yii\db\ColumnSchemaBuilder
first() 列にFIRST制約を追加します。 yii\db\ColumnSchemaBuilder
getCategoryMap() yii\db\ColumnSchemaBuilder
getCheckValue() 制約のCheck値を取得します。 yii\db\mssql\ColumnSchemaBuilder
getDefaultValue() 制約のDefault値を取得します。 yii\db\mssql\ColumnSchemaBuilder
hasMethod() メソッドが定義されているかどうかを示す値を返します。 yii\base\BaseObject
hasProperty() プロパティが定義されているかどうかを示す値を返します。 yii\base\BaseObject
init() オブジェクトを初期化します。 yii\base\BaseObject
isUnique() yii\db\mssql\ColumnSchemaBuilder
notNull() 列にNOT NULL制約を追加します。 yii\db\ColumnSchemaBuilder
null() 列にNULL制約を追加します。 yii\db\ColumnSchemaBuilder
setAlterColumnFormat() デフォルトのフォーマット文字列をMSSQL ALTERコマンドに変更します。 yii\db\mssql\ColumnSchemaBuilder
setCategoryMap() yii\db\ColumnSchemaBuilder
unique() 列にUNIQUE制約を追加します。 yii\db\ColumnSchemaBuilder
unsigned() 列を符号なしとしてマークします。 yii\db\ColumnSchemaBuilder

保護されたメソッド

継承されたメソッドを非表示

メソッド 説明 定義元
buildAfterString() 列のafter制約を構築します。デフォルトではサポートされていません。 yii\db\ColumnSchemaBuilder
buildAppendString() 列定義に付加されるカスタム文字列を構築します。 yii\db\ColumnSchemaBuilder
buildCheckString() 列のcheck制約を構築します。 yii\db\ColumnSchemaBuilder
buildCommentString() 列のコメント仕様を構築します。 yii\db\ColumnSchemaBuilder
buildCompleteString() 入力形式から完全な列定義を返します。 yii\db\ColumnSchemaBuilder
buildDefaultString() 列のデフォルト値仕様を構築します。 yii\db\ColumnSchemaBuilder
buildDefaultValue() 列のデフォルト値を返します。 yii\db\ColumnSchemaBuilder
buildFirstString() 列の最初の制約を構築します。デフォルトではサポートされていません。 yii\db\ColumnSchemaBuilder
buildLengthString() 列の長さ/精度部分を構築します。 yii\db\ColumnSchemaBuilder
buildNotNullString() 列のNOT NULL制約を構築します。 yii\db\ColumnSchemaBuilder
buildUniqueString() 列の一意制約を構築します。 yii\db\ColumnSchemaBuilder
buildUnsignedString() 列のunsigned文字列を構築します。デフォルトではサポートされていません。 yii\db\ColumnSchemaBuilder
getTypeCategory() 列の種類のカテゴリを返します。 yii\db\ColumnSchemaBuilder

定数

継承された定数を非表示

定数 説明 定義元
CATEGORY_NUMERIC 'numeric' yii\db\ColumnSchemaBuilder
CATEGORY_OTHER 'other' yii\db\ColumnSchemaBuilder
CATEGORY_PK 'pk' yii\db\ColumnSchemaBuilder
CATEGORY_STRING 'string' yii\db\ColumnSchemaBuilder
CATEGORY_TIME 'time' yii\db\ColumnSchemaBuilder

プロパティの詳細

継承されたプロパティを非表示

$checkValue public プロパティ

列のCHECK制約。

public string|null $checkValue null
$defaultValue public プロパティ

列のデフォルト値。

$format protected プロパティ
protected $format '{type}{length}{notnull}{unique}{default}{check}{append}'

メソッドの詳細

継承されたメソッドを非表示

__call() public メソッド

定義場所: yii\base\BaseObject::__call()

クラスメソッドではない名前付きメソッドを呼び出します。

これはPHPのマジックメソッドであり、未知のメソッドが呼び出された際に暗黙的に呼び出されるため、直接呼び出さないでください。

public mixed __call ( $name, $params )
$name string

メソッド名

$params array

メソッドパラメータ

戻り値 mixed

メソッドの戻り値

例外 yii\base\UnknownMethodException

未知のメソッドを呼び出した場合

                public function __call($name, $params)
{
    throw new UnknownMethodException('Calling unknown method: ' . get_class($this) . "::$name()");
}

            
__construct() public メソッド

定義場所: yii\db\ColumnSchemaBuilder::__construct()

型と値の精度を指定して、列スキーマビルダーインスタンスを作成します。

public void __construct ( $type, $length null, $db null, $config = [] )
$type string

列の種類。 $typeを参照してください。

$length integer|string|array|null

列の長さまたは精度。 $lengthを参照してください。

$db yii\db\Connection|null

現在のデータベース接続。 $dbを参照してください。

$config array

オブジェクトのプロパティを初期化するために使用される名前と値のペア

                public function __construct($type, $length = null, $db = null, $config = [])
{
    $this->type = $type;
    $this->length = $length;
    $this->db = $db;
    parent::__construct($config);
}

            
__get() public メソッド

定義場所: yii\base\BaseObject::__get()

オブジェクトプロパティの値を返します。

これはPHPのマジックメソッドであり、`$value = $object->property;`を実行した際に暗黙的に呼び出されるため、直接呼び出さないでください。

__set()も参照してください。

public mixed __get ( $name )
$name string

プロパティ名

戻り値 mixed

プロパティ値

例外 yii\base\UnknownPropertyException

プロパティが定義されていない場合

例外 yii\base\InvalidCallException

プロパティが書き込み専用の場合

                public function __get($name)
{
    $getter = 'get' . $name;
    if (method_exists($this, $getter)) {
        return $this->$getter();
    } elseif (method_exists($this, 'set' . $name)) {
        throw new InvalidCallException('Getting write-only property: ' . get_class($this) . '::' . $name);
    }
    throw new UnknownPropertyException('Getting unknown property: ' . get_class($this) . '::' . $name);
}

            
__isset() public メソッド

定義場所: yii\base\BaseObject::__isset()

プロパティが設定されているかどうか(定義されていてNULLでない)を確認します。

これはPHPのマジックメソッドであり、`isset($object->property)`を実行した際に暗黙的に呼び出されるため、直接呼び出さないでください。

プロパティが定義されていない場合、falseが返されることに注意してください。

https://www.php.net/manual/en/function.isset.phpも参照してください。

public boolean __isset ( $name )
$name string

プロパティ名またはイベント名

戻り値 boolean

指定されたプロパティが設定されているかどうか(NULLではないか)。

                public function __isset($name)
{
    $getter = 'get' . $name;
    if (method_exists($this, $getter)) {
        return $this->$getter() !== null;
    }
    return false;
}

            
__set() public メソッド

定義場所: yii\base\BaseObject::__set()

オブジェクトプロパティの値を設定します。

これはPHPのマジックメソッドであり、`$object->property = $value;`を実行した際に暗黙的に呼び出されるため、直接呼び出さないでください。

__get()も参照してください。

public void __set ( $name, $value )
$name string

プロパティ名またはイベント名

$value mixed

プロパティ値

例外 yii\base\UnknownPropertyException

プロパティが定義されていない場合

例外 yii\base\InvalidCallException

プロパティが読み取り専用の場合

                public function __set($name, $value)
{
    $setter = 'set' . $name;
    if (method_exists($this, $setter)) {
        $this->$setter($value);
    } elseif (method_exists($this, 'get' . $name)) {
        throw new InvalidCallException('Setting read-only property: ' . get_class($this) . '::' . $name);
    } else {
        throw new UnknownPropertyException('Setting unknown property: ' . get_class($this) . '::' . $name);
    }
}

            
__toString() public メソッド

列のスキーマの完全な文字列を構築します。

public string __toString ( )

                public function __toString()
{
    if ($this->getTypeCategory() === self::CATEGORY_PK) {
        $format = '{type}{check}{comment}{append}';
    } else {
        $format = $this->format;
    }
    return $this->buildCompleteString($format);
}

            
__unset() public メソッド

定義場所: yii\base\BaseObject::__unset()

オブジェクトプロパティをNULLに設定します。

これはPHPのマジックメソッドであり、`unset($object->property)`を実行した際に暗黙的に呼び出されるため、直接呼び出さないでください。

プロパティが定義されていない場合、このメソッドは何もしません。プロパティが読み取り専用の場合、例外をスローします。

参考: https://www.php.net/manual/en/function.unset.php

public void __unset ( $name )
$name string

プロパティ名

例外 yii\base\InvalidCallException

プロパティが読み取り専用の場合。

                public function __unset($name)
{
    $setter = 'set' . $name;
    if (method_exists($this, $setter)) {
        $this->$setter(null);
    } elseif (method_exists($this, 'get' . $name)) {
        throw new InvalidCallException('Unsetting read-only property: ' . get_class($this) . '::' . $name);
    }
}

            
after() publicメソッド (バージョン2.0.8から利用可能)

定義場所: yii\db\ColumnSchemaBuilder::after()

列にAFTER制約を追加します。

注記: MySQL、Oracle、Cubridのみサポート。

public $this after ( $after )
$after string

このカラムを追加する先のカラム。

                public function after($after)
{
    $this->after = $after;
    return $this;
}

            
append() publicメソッド (バージョン2.0.9から利用可能)

定義場所: yii\db\ColumnSchemaBuilder::append()

列定義に付加する追加のSQLを指定します。

位置修飾子は、それらをサポートするデータベースではカラム定義の後に追加されます。

public $this append ( $sql )
$sql string

追加するSQL文字列。

                public function append($sql)
{
    $this->append = $sql;
    return $this;
}

            
buildAfterString() protectedメソッド (バージョン2.0.8から利用可能)

定義場所: yii\db\ColumnSchemaBuilder::buildAfterString()

列のafter制約を構築します。デフォルトではサポートされていません。

protected string buildAfterString ( )
戻り値 string

AFTER制約を含む文字列。

                protected function buildAfterString()
{
    return '';
}

            
buildAppendString() protectedメソッド (バージョン2.0.9から利用可能)

定義場所: yii\db\ColumnSchemaBuilder::buildAppendString()

列定義に付加されるカスタム文字列を構築します。

protected string buildAppendString ( )
戻り値 string

追加するカスタム文字列。

                protected function buildAppendString()
{
    return $this->append !== null ? ' ' . $this->append : '';
}

            
buildCheckString() protectedメソッド

定義場所: yii\db\ColumnSchemaBuilder::buildCheckString()

列のcheck制約を構築します。

protected string buildCheckString ( )
戻り値 string

CHECK制約を含む文字列。

                protected function buildCheckString()
{
    return $this->check !== null ? " CHECK ({$this->check})" : '';
}

            
buildCommentString() protectedメソッド (バージョン2.0.8から利用可能)

定義場所: yii\db\ColumnSchemaBuilder::buildCommentString()

列のコメント仕様を構築します。

protected string buildCommentString ( )
戻り値 string

COMMENTキーワードとコメント自体を含む文字列。

                protected function buildCommentString()
{
    return '';
}

            
buildCompleteString() protectedメソッド (バージョン2.0.8から利用可能)

定義場所: yii\db\ColumnSchemaBuilder::buildCompleteString()

入力形式から完全な列定義を返します。

protected string buildCompleteString ( $format )
$format string

定義のフォーマット。

戻り値 string

完全なカラム定義を含む文字列。

                protected function buildCompleteString($format)
{
    $placeholderValues = [
        '{type}' => $this->type,
        '{length}' => $this->buildLengthString(),
        '{unsigned}' => $this->buildUnsignedString(),
        '{notnull}' => $this->buildNotNullString(),
        '{unique}' => $this->buildUniqueString(),
        '{default}' => $this->buildDefaultString(),
        '{check}' => $this->buildCheckString(),
        '{comment}' => $this->buildCommentString(),
        '{pos}' => $this->isFirst ? $this->buildFirstString() : $this->buildAfterString(),
        '{append}' => $this->buildAppendString(),
    ];
    return strtr($format, $placeholderValues);
}

            
buildDefaultString() protectedメソッド

定義場所: yii\db\ColumnSchemaBuilder::buildDefaultString()

列のデフォルト値仕様を構築します。

protected string buildDefaultString ( )
戻り値 string

カラムのデフォルト値を含む文字列。

                protected function buildDefaultString()
{
    $defaultValue = $this->buildDefaultValue();
    if ($defaultValue === null) {
        return '';
    }
    return ' DEFAULT ' . $defaultValue;
}

            
buildDefaultValue() protectedメソッド

定義場所: yii\db\ColumnSchemaBuilder::buildDefaultValue()

列のデフォルト値を返します。

protected string|null buildDefaultValue ( )
戻り値 string|null

カラムのデフォルト値を含む文字列。

                protected function buildDefaultValue()
{
    if ($this->default === null) {
        return $this->isNotNull === false ? 'NULL' : null;
    }
    switch (gettype($this->default)) {
        case 'double':
            // ensure type cast always has . as decimal separator in all locales
            $defaultValue = StringHelper::floatToString($this->default);
            break;
        case 'boolean':
            $defaultValue = $this->default ? 'TRUE' : 'FALSE';
            break;
        case 'integer':
        case 'object':
            $defaultValue = (string) $this->default;
            break;
        default:
            $defaultValue = "'{$this->default}'";
    }
    return $defaultValue;
}

            
buildFirstString() protectedメソッド (バージョン2.0.8から利用可能)

定義場所: yii\db\ColumnSchemaBuilder::buildFirstString()

列の最初の制約を構築します。デフォルトではサポートされていません。

protected string buildFirstString ( )
戻り値 string

FIRST制約を含む文字列。

                protected function buildFirstString()
{
    return '';
}

            
buildLengthString() protectedメソッド

定義場所: yii\db\ColumnSchemaBuilder::buildLengthString()

列の長さ/精度部分を構築します。

protected string buildLengthString ( )

                protected function buildLengthString()
{
    if ($this->length === null || $this->length === []) {
        return '';
    }
    if (is_array($this->length)) {
        $this->length = implode(',', $this->length);
    }
    return "({$this->length})";
}

            
buildNotNullString() protectedメソッド

定義場所: yii\db\ColumnSchemaBuilder::buildNotNullString()

列のNOT NULL制約を構築します。

protected string buildNotNullString ( )
戻り値 string

$isNotNull がtrueの場合'NOT NULL'を返し、$isNotNull がfalseの場合'NULL'を返し、それ以外の場合は空文字列を返します。

                protected function buildNotNullString()
{
    if ($this->isNotNull === true) {
        return ' NOT NULL';
    } elseif ($this->isNotNull === false) {
        return ' NULL';
    }
    return '';
}

            
buildUniqueString() protected メソッド

定義されている場所: yii\db\ColumnSchemaBuilder::buildUniqueString()

列の一意制約を構築します。

protected string buildUniqueString ( )
戻り値 string

$isUnique が true の場合、文字列 'UNIQUE' を返し、それ以外の場合は空文字列を返します。

                protected function buildUniqueString()
{
    return $this->isUnique ? ' UNIQUE' : '';
}

            
buildUnsignedString() protected メソッド (バージョン 2.0.7 から使用可能)

定義されている場所: yii\db\ColumnSchemaBuilder::buildUnsignedString()

列のunsigned文字列を構築します。デフォルトではサポートされていません。

protected string buildUnsignedString ( )
戻り値 string

UNSIGNED キーワードを含む文字列。

                protected function buildUnsignedString()
{
    return '';
}

            
canGetProperty() public メソッド

定義されている場所: yii\base\BaseObject::canGetProperty()

プロパティを読み取ることができるかどうかを示す値を返します。

プロパティは、以下の場合に読み取り可能です。

  • クラスが指定された名前と関連付けられたゲッターメソッドを持っている場合(この場合、プロパティ名はケースインセンシティブです)。
  • クラスが指定された名前のメンバ変数を持っている場合($checkVars が true の場合)。

こちらも参照してください canSetProperty().

public boolean canGetProperty ( $name, $checkVars true )
$name string

プロパティ名

$checkVars boolean

メンバ変数をプロパティとして扱うかどうか

戻り値 boolean

プロパティを読み取ることができるかどうか

                public function canGetProperty($name, $checkVars = true)
{
    return method_exists($this, 'get' . $name) || $checkVars && property_exists($this, $name);
}

            
canSetProperty() public メソッド

定義されている場所: yii\base\BaseObject::canSetProperty()

プロパティを設定できるかどうかを示す値を返します。

プロパティは、以下の場合に書き込み可能です。

  • クラスが指定された名前と関連付けられたセッターメソッドを持っている場合(この場合、プロパティ名はケースインセンシティブです)。
  • クラスが指定された名前のメンバ変数を持っている場合($checkVars が true の場合)。

こちらも参照してください canGetProperty().

public boolean canSetProperty ( $name, $checkVars true )
$name string

プロパティ名

$checkVars boolean

メンバ変数をプロパティとして扱うかどうか

戻り値 boolean

プロパティを書き込むことができるかどうか

                public function canSetProperty($name, $checkVars = true)
{
    return method_exists($this, 'set' . $name) || $checkVars && property_exists($this, $name);
}

            
check() public メソッド

定義されている場所: yii\db\ColumnSchemaBuilder::check()

列のCHECK制約を設定します。

public $this check ( $check )
$check string

追加するCHECK制約のSQL。

                public function check($check)
{
    $this->check = $check;
    return $this;
}

            
className() public static メソッド
2.0.14 から非推奨。PHP >= 5.5 では、代わりに::classを使用してください。

定義されている場所: yii\base\BaseObject::className()

このクラスの完全修飾名を返します。

public static string className ( )
戻り値 string

このクラスの完全修飾名。

                public static function className()
{
    return get_called_class();
}

            
comment() public メソッド (バージョン 2.0.8 から使用可能)

定義されている場所: yii\db\ColumnSchemaBuilder::comment()

列のコメントを指定します。

public $this comment ( $comment )
$comment string

コメント

                public function comment($comment)
{
    $this->comment = $comment;
    return $this;
}

            
defaultExpression() public メソッド (バージョン 2.0.7 から使用可能)

定義されている場所: yii\db\ColumnSchemaBuilder::defaultExpression()

列のデフォルトSQL式を指定します。

public $this defaultExpression ( $default )
$default string

デフォルト値の式。

                public function defaultExpression($default)
{
    $this->default = new Expression($default);
    return $this;
}

            
defaultValue() public メソッド

定義されている場所: yii\db\ColumnSchemaBuilder::defaultValue()

列のデフォルト値を指定します。

public $this defaultValue ( $default )
$default mixed

デフォルト値。

                public function defaultValue($default)
{
    if ($default === null) {
        $this->null();
    }
    $this->default = $default;
    return $this;
}

            
first() public メソッド (バージョン 2.0.8 から使用可能)

定義されている場所: yii\db\ColumnSchemaBuilder::first()

列にFIRST制約を追加します。

注記: MySQL、Oracle、Cubridのみサポート。

public $this first ( )

                public function first()
{
    $this->isFirst = true;
    return $this;
}

            
getCategoryMap() public メソッド (バージョン 2.0.43 から使用可能)

定義されている場所: yii\db\ColumnSchemaBuilder::getCategoryMap()

public array getCategoryMap ( )
戻り値 array

抽象的な列の種類(キー)から種類カテゴリ(値)へのマッピング。

                public function getCategoryMap()
{
    return static::$typeCategoryMap;
}

            
getCheckValue() public メソッド

制約のCheck値を取得します。

public string|null getCheckValue ( )
戻り値 string|null

列のCHECK制約。

                public function getCheckValue()
{
    return $this->check !== null ? (string) $this->check : null;
}

            
getDefaultValue() public メソッド

制約のDefault値を取得します。

public string|yii\db\Expression|null getDefaultValue ( )
戻り値 string|yii\db\Expression|null

列のデフォルト値。

                public function getDefaultValue()
{
    if ($this->default instanceof Expression) {
        return $this->default;
    }
    return $this->buildDefaultValue();
}

            
getTypeCategory() protected メソッド (バージョン 2.0.8 から使用可能)

定義先: yii\db\ColumnSchemaBuilder::getTypeCategory()

列の種類のカテゴリを返します。

protected string getTypeCategory ( )
戻り値 string

カラムの種類カテゴリ名を格納した文字列。

                protected function getTypeCategory()
{
    return isset($this->categoryMap[$this->type]) ? $this->categoryMap[$this->type] : null;
}

            
hasMethod() publicメソッド

定義先: yii\base\BaseObject::hasMethod()

メソッドが定義されているかどうかを示す値を返します。

デフォルトの実装は、PHP関数`method_exists()`の呼び出しです。PHPマジックメソッド`__call()`を実装した場合は、このメソッドをオーバーライドできます。

public boolean hasMethod ( $name )
$name string

メソッド名

戻り値 boolean

メソッドが定義されているかどうか

                public function hasMethod($name)
{
    return method_exists($this, $name);
}

            
hasProperty() publicメソッド

定義先: yii\base\BaseObject::hasProperty()

プロパティが定義されているかどうかを示す値を返します。

プロパティは、以下の場合に定義されています。

  • 指定された名前と関連付けられたゲッターまたはセッターメソッドがクラスに存在する場合(この場合、プロパティ名はケースインセンシティブです)。
  • クラスが指定された名前のメンバ変数を持っている場合($checkVars が true の場合)。

参照

public boolean hasProperty ( $name, $checkVars true )
$name string

プロパティ名

$checkVars boolean

メンバ変数をプロパティとして扱うかどうか

戻り値 boolean

プロパティが定義されているかどうか

                public function hasProperty($name, $checkVars = true)
{
    return $this->canGetProperty($name, $checkVars) || $this->canSetProperty($name, false);
}

            
init() publicメソッド

定義先: yii\base\BaseObject::init()

オブジェクトを初期化します。

このメソッドは、オブジェクトが指定された設定で初期化された後、コンストラクタの最後に呼び出されます。

public void init ( )

                public function init()
{
}

            
isUnique() publicメソッド

public boolean isUnique ( )
戻り値 boolean

カラムの値が一意である必要があるかどうか。これが`true`の場合、`UNIQUE`制約が追加されます。

                public function isUnique()
{
    return $this->isUnique;
}

            
notNull() publicメソッド

定義先: yii\db\ColumnSchemaBuilder::notNull()

列にNOT NULL制約を追加します。

public $this notNull ( )

                public function notNull()
{
    $this->isNotNull = true;
    return $this;
}

            
null() publicメソッド (バージョン2.0.9から利用可能)

定義先: yii\db\ColumnSchemaBuilder::null()

列にNULL制約を追加します。

public $this null ( )

                public function null()
{
    $this->isNotNull = false;
    return $this;
}

            
setAlterColumnFormat() publicメソッド

デフォルトのフォーマット文字列をMSSQL ALTERコマンドに変更します。

public void setAlterColumnFormat ( )

                public function setAlterColumnFormat()
{
    $this->format = '{type}{length}{notnull}{append}';
}

            
setCategoryMap() publicメソッド (バージョン2.0.43から利用可能)
public void setCategoryMap ( $categoryMap )
$categoryMap array

抽象的な列の種類(キー)から種類カテゴリ(値)へのマッピング。

                public function setCategoryMap($categoryMap)
{
    static::$typeCategoryMap = $categoryMap;
}

            
unique() publicメソッド

定義先: yii\db\ColumnSchemaBuilder::unique()

列にUNIQUE制約を追加します。

public $this unique ( )

                public function unique()
{
    $this->isUnique = true;
    return $this;
}

            
unsigned() publicメソッド (バージョン2.0.7から利用可能)

定義先: yii\db\ColumnSchemaBuilder::unsigned()

列を符号なしとしてマークします。

public $this unsigned ( )

                public function unsigned()
{
    switch ($this->type) {
        case Schema::TYPE_PK:
            $this->type = Schema::TYPE_UPK;
            break;
        case Schema::TYPE_BIGPK:
            $this->type = Schema::TYPE_UBIGPK;
            break;
    }
    $this->isUnsigned = true;
    return $this;
}