db\ActiveRecordInterface getRelation()

getRelation() public abstract method

Returns the relation object with the specified name.

A relation is defined by a getter method which returns an object implementing the yii\db\ActiveQueryInterface (normally this would be a relational yii\db\ActiveQuery object). It can be declared in either the ActiveRecord class itself or one of its behaviors.

public abstract yii\db\ActiveQueryInterface getRelation ( $name, $throwException = true )
$name string

The relation name, e.g. orders for a relation defined via getOrders() method (case-sensitive).

$throwException boolean

Whether to throw exception if the relation does not exist.

return yii\db\ActiveQueryInterface

The relational query object

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

Please login to continue.