getRelation() public method
Returns the relation object with the specified name.
A relation is defined by a getter method which returns an yii\db\ActiveQueryInterface object. It can be declared in either the Active Record class itself or one of its behaviors.
| public yii\db\ActiveQueryInterface|yii\db\ActiveQuery getRelation ( $name, $throwException = true ) | ||
|---|---|---|
| $name | string |
The relation name, e.g. |
| $throwException | boolean |
Whether to throw exception if the relation does not exist. |
| return | yii\db\ActiveQueryInterface|yii\db\ActiveQuery |
The relational query object. If the relation does not exist and |
| throws | yii\base\InvalidParamException |
if the named relation does not exist. |
Please login to continue.