db\BaseActiveRecord $primaryKey

$primaryKey public read-only property 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). public mixed getPrimaryKey ( $asArray = false )

db\BaseActiveRecord $isNewRecord

$isNewRecord public property Whether the record is new and should be inserted when calling save(). public boolean getIsNewRecord ( )public void setIsNewRecord ( $value )

db\BaseActiveRecord $dirtyAttributes

$dirtyAttributes public read-only property The changed attribute values (name-value pairs) public array getDirtyAttributes ( $names = null )

db\AfterSaveEvent $changedAttributes

$changedAttributes public property The attribute values that had changed and were saved. public array $changedAttributes = null

db\ActiveRelationTrait via()

via() public method Specifies the relation associated with the junction table. Use this method to specify a pivot record/table when declaring a relation in the yii\db\ActiveRecord class: public function getOrders() { return $this->hasOne(Order::className(), ['id' => 'order_id']); } public function getOrderItems() { return $this->hasMany(Item::className(), ['id' => 'item_id']) ->via('orders'); } public $this via ( $relationName, callable $callable =

db\ActiveRelationTrait __clone()

__clone() public method Clones internal objects. public void __clone ( )

db\ActiveRelationTrait populateRelation()

populateRelation() public method Finds the related records and populates them into the primary models. public array populateRelation ( $name, &$primaryModels )$name string The relation name $primaryModels array Primary models return array The related models throws yii\base\InvalidConfigException if $link is invalid

db\ActiveRelationTrait findFor()

findFor() public method Finds the related records for the specified primary record. This method is invoked when a relation of an ActiveRecord is being accessed in a lazy fashion. public mixed findFor ( $name, $model )$name string The relation name $model yii\db\ActiveRecordInterface|yii\db\BaseActiveRecord The primary model return mixed The related record(s) throws yii\base\InvalidParamException if the relation is invalid

db\ActiveRelationTrait $via

$via public property The query associated with the junction table. Please call via() to set this property instead of directly setting it. This property is only used in relational context. See also via(). public array|object $via = null

db\ActiveRelationTrait inverseOf()

inverseOf() public method Sets the name of the relation that is the inverse of this relation. For example, an order has a customer, which means the inverse of the "customer" relation is the "orders", and the inverse of the "orders" relation is the "customer". If this property is set, the primary record(s) will be referenced through the specified relation. For example, $customer->orders[0]->customer and $customer will be the same object, and accessing the customer of an order will not