TheStoryCoder TheStoryCoder - 10 months ago 51
PHP Question

Yii2: What is the relation name?

For the ActiveRecord, what is "the name of the relation" that is to be used in eg.

- where is that defined?

The documentation now includes an example - though it doesn't show exactly how the camel case name is converted - as the answer to this question does.

Answer Source

If you have got relation set like:

public function getRelationName()

Relation name is relationName.