Returns the primary key name(s) for this AR class.
The default implementation will return the primary key(s) as declared in the DB table that is associated with this AR class.
If the DB table does not declare any primary key, you should override this method to return the attributes that you want to use as primary keys for this AR class.
Note that an array should be returned even for a table with single primary key.
public static string[] primaryKey ( ) | ||
return | string[] |
The primary keys of the associated database table. |
---|
public static function primaryKey()
{
return static::getTableSchema()->primaryKey;
}
In the next anchor
https://www.yiiframework.com/doc/api/2.0/yii-db-activerecord#hasMany()-detail
the next text is twice:
see yii\db\BaseActiveRecord::hasMany() for more info
In the next anchor
https://www.yiiframework.com/doc/api/2.0/yii-db-activerecord#hasOne()-detail
the next text is twice:
see yii\db\BaseActiveRecord::hasOne() for more info
Signup or Login in order to comment.