Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Rotua Panjaitan
yii2
Commits
5a8afcf7
Commit
5a8afcf7
authored
Nov 23, 2013
by
Klimov Paul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
"yii\sphinx\ActiveQuery" updated to throw exception on conflict between…
"yii\sphinx\ActiveQuery" updated to throw exception on conflict between "asArray" and "snippetByModel" options.
parent
2c22fe3f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
ActiveQuery.php
extensions/sphinx/ActiveQuery.php
+5
-0
No files found.
extensions/sphinx/ActiveQuery.php
View file @
5a8afcf7
...
@@ -7,6 +7,7 @@
...
@@ -7,6 +7,7 @@
namespace
yii\sphinx
;
namespace
yii\sphinx
;
use
yii\base\InvalidCallException
;
use
yii\db\ActiveQueryInterface
;
use
yii\db\ActiveQueryInterface
;
use
yii\db\ActiveQueryTrait
;
use
yii\db\ActiveQueryTrait
;
...
@@ -186,10 +187,14 @@ class ActiveQuery extends Query implements ActiveQueryInterface
...
@@ -186,10 +187,14 @@ class ActiveQuery extends Query implements ActiveQueryInterface
/**
/**
* Fetches the source for the snippets using [[ActiveRecord::getSnippetSource()]] method.
* Fetches the source for the snippets using [[ActiveRecord::getSnippetSource()]] method.
* @param ActiveRecord[] $models raw query result rows.
* @param ActiveRecord[] $models raw query result rows.
* @throws \yii\base\InvalidCallException if [[asArray]] enabled.
* @return array snippet source strings
* @return array snippet source strings
*/
*/
protected
function
fetchSnippetSourceFromModels
(
$models
)
protected
function
fetchSnippetSourceFromModels
(
$models
)
{
{
if
(
$this
->
asArray
)
{
throw
new
InvalidCallException
(
'"'
.
__METHOD__
.
'" unable to determine snippet source from plain array. Either disable "asArray" option or use regular "snippetCallback"'
);
}
$result
=
[];
$result
=
[];
foreach
(
$models
as
$model
)
{
foreach
(
$models
as
$model
)
{
$result
[]
=
$model
->
getSnippetSource
();
$result
[]
=
$model
->
getSnippetSource
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment