yiisoft/yii2 — pull request #485 by creocoder (2013-06-03 18:47:29+00:00)
Title: Object::spaceName()

For example we have models:

```
namespace common\models;

class Article extends ActiveRecord
{
public function getCategory()
{
$class = self::spaceName() . '/Category';
return $class::find()->all();
}
}
```

```
namespace backend\models;

class Article extends \common\models\Article
{
}
```

```
namespace frontend\models;

class Article extends \common\models\Article
{
}
```

So code like:

```
use frontend\models\Article;
...
$article->category //gets \frontend\models\Category
```

```
use baclend\models\Article;
...
$article->category //gets \backend\models\Category
```