snippetByModel() public method
Sets the snippetCallback() to fetchSnippetSourceFromModels(), which allows to fetch the snippet source strings from the Active Record models, using method yii\sphinx\ActiveRecord::getSnippetSource().
For example:
class Article extends ActiveRecord { public function getSnippetSource() { return file_get_contents('/path/to/source/files/' . $this->id . '.txt');; } } $articles = Article::find()->snippetByModel()->all();
Warning: this option should NOT be used with asArray() at the same time!
public $this snippetByModel ( ) | ||
---|---|---|
return | $this |
The query object itself |
Please login to continue.