db\BaseActiveRecord getPrimaryKey()

getPrimaryKey() public method

Returns the primary key value(s).

public mixed getPrimaryKey ( $asArray = false )
$asArray boolean

Whether to return the primary key value as an array. If true, the return value will be an array with column names as keys and column values as values. Note that for composite primary keys, an array will always be returned regardless of this parameter value.

return mixed

The primary key value. An array (column name => column value) is returned if the primary key is composite or $asArray is true. A string is returned otherwise (null will be returned if the key value is null).

doc_Yii
2016-10-30 16:56:47
Comments
Leave a Comment

Please login to continue.