mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-29 05:47:17 +08:00
Sphinx Active Relation created
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace yiiunit\data\sphinx\ar;
|
||||
|
||||
use yii\sphinx\ActiveRelation;
|
||||
use yiiunit\data\ar\ActiveRecord as ActiveRecordDb;
|
||||
|
||||
class ArticleDb extends ActiveRecordDb
|
||||
@@ -10,4 +11,15 @@ class ArticleDb extends ActiveRecordDb
|
||||
{
|
||||
return 'yii2_test_article';
|
||||
}
|
||||
|
||||
public function getIndex()
|
||||
{
|
||||
$config = [
|
||||
'modelClass' => ArticleIndex::className(),
|
||||
'primaryModel' => $this,
|
||||
'link' => ['id' => 'id'],
|
||||
'multiple' => false,
|
||||
];
|
||||
return new ActiveRelation($config);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user