Defined in: yii\db\ActiveRecordInterface::primaryKey()
Returns the primary key name(s) for this AR class.
Note that an array should be returned even when the record only has a single primary key.
For the primary key value see getPrimaryKey() instead.
public abstract static string[] primaryKey ( ) | ||
return | string[] |
The primary key name(s) for this AR class. |
---|
public static function primaryKey();
Just a note on the
save()
method,$attributeNames
description.It says: "List of attribute names that need to be saved. Defaults to null, meaning all attributes that are loaded from DB will be saved."
This is not 100% true, since Yii 2 only saves dirty attributes (https://www.yiiframework.com/doc/guide/2.0/en/db-active-record#dirty-attributes).
(this is a huge improvement from Yii 1, btw!)
Some thing wrong with api docs
> EVENT_AFTER_FIND yii\db\Event
But no class Event with namespace yii\db exists - and looks like must be yii\base\ModelEvent
Signup or Login in order to comment.