mirror of
https://github.com/yiisoft/yii2.git
synced 2026-03-09 16:57:53 +01:00
42 lines
747 B
PHP
42 lines
747 B
PHP
<?php
|
|
namespace yiiunit\data\ar\sphinx;
|
|
|
|
class ArticleIndex extends ActiveRecord
|
|
{
|
|
public $custom_column;
|
|
|
|
/**
|
|
* @inheritdoc
|
|
*/
|
|
public static function indexName()
|
|
{
|
|
return 'yii2_test_article_index';
|
|
}
|
|
|
|
public function getSource()
|
|
{
|
|
return $this->hasOne(ArticleDb::className(), ['id' => 'id']);
|
|
}
|
|
|
|
public function getTags()
|
|
{
|
|
return $this->hasMany(TagDb::className(), ['id' => 'tag']);
|
|
}
|
|
|
|
/**
|
|
* @inheritdoc
|
|
*/
|
|
public function getSnippetSource()
|
|
{
|
|
return $this->source->content;
|
|
}
|
|
|
|
/**
|
|
* @return ArticleIndexQuery
|
|
*/
|
|
public static function find()
|
|
{
|
|
return new ArticleIndexQuery(get_called_class());
|
|
}
|
|
}
|