ArticleDb.php 453 Bytes
Newer Older
1 2
<?php

3
namespace yiiunit\data\ar\sphinx;
4

5
use yii\sphinx\ActiveQuery;
6
use yiiunit\data\ar\ActiveRecord as ActiveRecordDb;
7

8
class ArticleDb extends ActiveRecordDb
9 10 11 12 13
{
	public static function tableName()
	{
		return 'yii2_test_article';
	}
14 15 16 17 18 19 20 21 22

	public function getIndex()
	{
		$config = [
			'modelClass' => ArticleIndex::className(),
			'primaryModel' => $this,
			'link' => ['id' => 'id'],
			'multiple' => false,
		];
23
		return new ActiveQuery($config);
24
	}
25
}