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
be2b76d4
Commit
be2b76d4
authored
Feb 12, 2014
by
Paul Klimov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Method "callSnippetsInternal" for the Sphinx Query extracted
parent
1e585707
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
1 deletion
+28
-1
ActiveQuery.php
extensions/sphinx/ActiveQuery.php
+15
-0
Query.php
extensions/sphinx/Query.php
+13
-1
No files found.
extensions/sphinx/ActiveQuery.php
View file @
be2b76d4
...
...
@@ -201,4 +201,19 @@ class ActiveQuery extends Query implements ActiveQueryInterface
}
return
$result
;
}
/**
* @inheritdoc
*/
protected
function
callSnippets
(
array
$source
)
{
$from
=
$this
->
from
;
if
(
$from
===
null
)
{
/** @var ActiveRecord $modelClass */
$modelClass
=
$this
->
modelClass
;
$tableName
=
$modelClass
::
indexName
();
$from
=
[
$tableName
];
}
return
$this
->
callSnippetsInternal
(
$source
,
$from
[
0
]);
}
}
extensions/sphinx/Query.php
View file @
be2b76d4
...
...
@@ -693,13 +693,25 @@ class Query extends Component implements QueryInterface
*/
protected
function
callSnippets
(
array
$source
)
{
return
$this
->
callSnippetsInternal
(
$source
,
$this
->
from
[
0
]);
}
/**
* Builds a snippets from provided source data by the given index.
* @param array $source the source data to extract a snippet from.
* @param string $from name of the source index.
* @return array snippets list.
* @throws InvalidCallException in case [[match]] is not specified.
*/
protected
function
callSnippetsInternal
(
array
$source
,
$from
)
{
$connection
=
$this
->
getConnection
();
$match
=
$this
->
match
;
if
(
$match
===
null
)
{
throw
new
InvalidCallException
(
'Unable to call snippets: "'
.
$this
->
className
()
.
'::match" should be specified.'
);
}
return
$connection
->
createCommand
()
->
callSnippets
(
$
this
->
from
[
0
]
,
$source
,
$match
,
$this
->
snippetOptions
)
->
callSnippets
(
$
from
,
$source
,
$match
,
$this
->
snippetOptions
)
->
queryColumn
();
}
}
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