yiisoft/yii2 — pull request #2311 by Alex-Code (2014-02-04 14:21:26+00:00)
Title: Update ActiveRecord.php

New method "relationAlias".
For use with multiple self joining relations (Table with parent-child relations).

So a relation like,
```
public function getParent()
{
return $this->hasOne(self::className(), ['id' => 'parent_id'])
->from(self::relationAlias('p'));
}
```
Can be used like,
```
->joinWith('parent.parent.parent')
```
Without needing to set the ```from``` manually for each one.