db\BaseActiveRecord hasAttribute()

hasAttribute() public method Returns a value indicating whether the model has an attribute with the specified name. public boolean hasAttribute ( $name )$name string The name of the attribute return boolean Whether the model has an attribute with the specified name.

db\BaseActiveRecord hasMany()

hasMany() public method Declares a has-many relation. The declaration is returned in terms of a relational yii\db\ActiveQuery instance through which the related record can be queried and retrieved back. A has-many relation means that there are multiple related records matching the criteria set by this relation, e.g., a customer has many orders. For example, to declare the orders relation for Customer class, we can write the following code in the Customer class: public function getOrders() {

db\BaseActiveRecord getRelatedRecords()

getRelatedRecords() public method Returns all populated related records. See also getRelation(). public array getRelatedRecords ( )return array An array of related records indexed by relation names.

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

db\BaseActiveRecord getOldPrimaryKey()

getOldPrimaryKey() public method Returns the old primary key value(s). This refers to the primary key value that is populated into the record after executing a find method (e.g. find(), findOne()). The value remains unchanged even if the primary key attribute is manually assigned with a different value. public mixed getOldPrimaryKey ( $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 name as key

db\BaseActiveRecord getIsNewRecord()

getIsNewRecord() public method Returns a value indicating whether the current record is new. public boolean getIsNewRecord ( )return boolean Whether the record is new and should be inserted when calling save().

db\BaseActiveRecord getOldAttribute()

getOldAttribute() public method Returns the old value of the named attribute. If this record is the result of a query and the attribute is not loaded, null will be returned. See also hasAttribute(). public mixed getOldAttribute ( $name )$name string The attribute name return mixed The old attribute value. null if the attribute is not loaded before or does not exist.

db\BaseActiveRecord getOldAttributes()

getOldAttributes() public method Returns the old attribute values. public array getOldAttributes ( )return array The old attribute values (name-value pairs)

db\BaseActiveRecord getAttributeLabel()

getAttributeLabel() public method Returns the text label for the specified attribute. If the attribute looks like relatedModel.attribute, then the attribute will be received from the related model. See also: generateAttributeLabel() attributeLabels() public string getAttributeLabel ( $attribute )$attribute string The attribute name return string The attribute label

db\BaseActiveRecord getAttributeHint()

getAttributeHint() public method (available since version 2.0.4) Returns the text hint for the specified attribute. If the attribute looks like relatedModel.attribute, then the attribute will be received from the related model. See also attributeHints(). public string getAttributeHint ( $attribute )$attribute string The attribute name return string The attribute hint