Sphinx Active Relation created

This commit is contained in:
Paul Klimov
2013-11-18 16:56:28 +02:00
parent c355fed280
commit 6bfc888c8f
4 changed files with 104 additions and 24 deletions

View File

@@ -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);
}
}