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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
10edf5c9
Commit
10edf5c9
authored
10 years ago
by
Klimov Paul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
`yii\sphinx\ActiveQuery` fixed to be resuable.
parent
981fbadd
master
No related merge requests found
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
3 deletions
+15
-3
ActiveQuery.php
extensions/sphinx/ActiveQuery.php
+5
-3
ActiveRecordTest.php
tests/unit/extensions/sphinx/ActiveRecordTest.php
+10
-0
No files found.
extensions/sphinx/ActiveQuery.php
View file @
10edf5c9
...
...
@@ -248,12 +248,14 @@ class ActiveQuery extends Query implements ActiveQueryInterface
$this
->
setConnection
(
$db
);
$db
=
$this
->
getConnection
();
$params
=
$this
->
params
;
if
(
$this
->
sql
===
null
)
{
list
(
$this
->
sql
,
$params
)
=
$db
->
getQueryBuilder
()
->
build
(
$this
);
list
(
$sql
,
$params
)
=
$db
->
getQueryBuilder
()
->
build
(
$this
);
}
else
{
$sql
=
$this
->
sql
;
$params
=
$this
->
params
;
}
return
$db
->
createCommand
(
$
this
->
sql
,
$params
);
return
$db
->
createCommand
(
$sql
,
$params
);
}
/**
...
...
This diff is collapsed.
Click to expand it.
tests/unit/extensions/sphinx/ActiveRecordTest.php
View file @
10edf5c9
...
...
@@ -234,4 +234,14 @@ class ActiveRecordTest extends SphinxTestCase
$this
->
assertArrayHasKey
(
'tokenized'
,
$rows
[
0
],
'No tokenized keyword!'
);
$this
->
assertArrayHasKey
(
'normalized'
,
$rows
[
0
],
'No normalized keyword!'
);
}
/**
* @depends testFind
*/
public
function
testFindQueryReuse
()
{
$result
=
ArticleIndex
::
find
()
->
andWhere
([
'author_id'
=>
1
]);
$this
->
assertTrue
(
$result
->
one
()
instanceof
ArticleIndex
);
$this
->
assertTrue
(
$result
->
one
()
instanceof
ArticleIndex
);
}
}
This diff is collapsed.
Click to expand it.
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