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
54e08f3f
Commit
54e08f3f
authored
Apr 03, 2014
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed build break.
parent
8b4dfcc8
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
78 additions
and
20 deletions
+78
-20
ActiveQuery.php
extensions/elasticsearch/ActiveQuery.php
+11
-0
ActiveQuery.php
extensions/mongodb/ActiveQuery.php
+12
-0
ActiveQuery.php
extensions/mongodb/file/ActiveQuery.php
+12
-0
ActiveQuery.php
extensions/redis/ActiveQuery.php
+14
-1
ActiveQuery.php
extensions/sphinx/ActiveQuery.php
+12
-0
AttributeBehavior.php
framework/behaviors/AttributeBehavior.php
+3
-2
ActiveQuery.php
framework/db/ActiveQuery.php
+12
-2
ActiveQueryTrait.php
framework/db/ActiveQueryTrait.php
+0
-10
ArticleDb.php
tests/unit/data/ar/sphinx/ArticleDb.php
+2
-5
No files found.
extensions/elasticsearch/ActiveQuery.php
View file @
54e08f3f
...
...
@@ -79,6 +79,17 @@ class ActiveQuery extends Query implements ActiveQueryInterface
/**
* Constructor.
* @param array $modelClass the model class associated with this query
* @param array $config configurations to be applied to the newly created query object
*/
public
function
__construct
(
$modelClass
,
$config
=
[])
{
$this
->
modelClass
=
$modelClass
;
parent
::
__construct
(
$config
);
}
/**
* Creates a DB command that can be used to execute this query.
* @param Connection $db the DB connection used to create the DB command.
* If null, the DB connection returned by [[modelClass]] will be used.
...
...
extensions/mongodb/ActiveQuery.php
View file @
54e08f3f
...
...
@@ -64,6 +64,18 @@ class ActiveQuery extends Query implements ActiveQueryInterface
use
ActiveQueryTrait
;
use
ActiveRelationTrait
;
/**
* Constructor.
* @param array $modelClass the model class associated with this query
* @param array $config configurations to be applied to the newly created query object
*/
public
function
__construct
(
$modelClass
,
$config
=
[])
{
$this
->
modelClass
=
$modelClass
;
parent
::
__construct
(
$config
);
}
/**
* @inheritdoc
*/
...
...
extensions/mongodb/file/ActiveQuery.php
View file @
54e08f3f
...
...
@@ -40,6 +40,18 @@ class ActiveQuery extends Query implements ActiveQueryInterface
use
ActiveQueryTrait
;
use
ActiveRelationTrait
;
/**
* Constructor.
* @param array $modelClass the model class associated with this query
* @param array $config configurations to be applied to the newly created query object
*/
public
function
__construct
(
$modelClass
,
$config
=
[])
{
$this
->
modelClass
=
$modelClass
;
parent
::
__construct
(
$config
);
}
/**
* Executes query and returns all results as an array.
* @param \yii\mongodb\Connection $db the Mongo connection used to execute the query.
...
...
extensions/redis/ActiveQuery.php
View file @
54e08f3f
...
...
@@ -7,6 +7,7 @@
namespace
yii\redis
;
use
yii\base\Component
;
use
yii\base\InvalidParamException
;
use
yii\base\NotSupportedException
;
use
yii\db\ActiveQueryInterface
;
...
...
@@ -70,12 +71,24 @@ use yii\db\QueryTrait;
* @author Carsten Brandt <mail@cebe.cc>
* @since 2.0
*/
class
ActiveQuery
extends
\yii\base\
Component
implements
ActiveQueryInterface
class
ActiveQuery
extends
Component
implements
ActiveQueryInterface
{
use
QueryTrait
;
use
ActiveQueryTrait
;
use
ActiveRelationTrait
;
/**
* Constructor.
* @param array $modelClass the model class associated with this query
* @param array $config configurations to be applied to the newly created query object
*/
public
function
__construct
(
$modelClass
,
$config
=
[])
{
$this
->
modelClass
=
$modelClass
;
parent
::
__construct
(
$config
);
}
/**
* Executes the query and returns all results as an array.
* @param Connection $db the database connection used to execute the query.
...
...
extensions/sphinx/ActiveQuery.php
View file @
54e08f3f
...
...
@@ -91,6 +91,18 @@ class ActiveQuery extends Query implements ActiveQueryInterface
*/
public
$sql
;
/**
* Constructor.
* @param array $modelClass the model class associated with this query
* @param array $config configurations to be applied to the newly created query object
*/
public
function
__construct
(
$modelClass
,
$config
=
[])
{
$this
->
modelClass
=
$modelClass
;
parent
::
__construct
(
$config
);
}
/**
* Sets the [[snippetCallback]] to [[fetchSnippetSourceFromModels()]], which allows to
* fetch the snippet source strings from the Active Record models, using method
...
...
framework/behaviors/AttributeBehavior.php
View file @
54e08f3f
...
...
@@ -66,7 +66,8 @@ class AttributeBehavior extends Behavior
* The signature of the function should be as follows,
*
* ```php
* function ($event) {
* function ($event)
* {
* // return value will be assigned to the attribute
* }
* ```
...
...
@@ -83,7 +84,7 @@ class AttributeBehavior extends Behavior
/**
* Evaluates the attribute value and assigns it to the current attributes.
* @param $event
* @param
Event
$event
*/
public
function
evaluateAttributes
(
$event
)
{
...
...
framework/db/ActiveQuery.php
View file @
54e08f3f
...
...
@@ -93,6 +93,17 @@ class ActiveQuery extends Query implements ActiveQueryInterface
/**
* Constructor.
* @param array $modelClass the model class associated with this query
* @param array $config configurations to be applied to the newly created query object
*/
public
function
__construct
(
$modelClass
,
$config
=
[])
{
$this
->
modelClass
=
$modelClass
;
parent
::
__construct
(
$config
);
}
/**
* Executes query and returns all results as an array.
* @param Connection $db the DB connection used to create the DB command.
* If null, the DB connection returned by [[modelClass]] will be used.
...
...
@@ -682,8 +693,7 @@ class ActiveQuery extends Query implements ActiveQueryInterface
*/
public
function
viaTable
(
$tableName
,
$link
,
$callable
=
null
)
{
$relation
=
new
ActiveQuery
([
'modelClass'
=>
get_class
(
$this
->
primaryModel
),
$relation
=
new
ActiveQuery
(
get_class
(
$this
->
primaryModel
),
[
'from'
=>
[
$tableName
],
'link'
=>
$link
,
'multiple'
=>
true
,
...
...
framework/db/ActiveQueryTrait.php
View file @
54e08f3f
...
...
@@ -31,16 +31,6 @@ trait ActiveQueryTrait
public
$asArray
;
/**
* Constructor.
* @param array $modelClass the model class associated with this query
* @param array $config configurations to be applied to the newly created query object
*/
public
function
__construct
(
$modelClass
,
$config
=
[])
{
$this
->
modelClass
=
$modelClass
;
parent
::
__construct
(
$config
);
}
/**
* Sets the [[asArray]] property.
...
...
tests/unit/data/ar/sphinx/ArticleDb.php
View file @
54e08f3f
...
...
@@ -14,13 +14,10 @@ class ArticleDb extends ActiveRecordDb
public
function
getIndex
()
{
$config
=
[
'modelClass'
=>
ArticleIndex
::
className
(),
return
new
ActiveQuery
(
ArticleIndex
::
className
(),
[
'primaryModel'
=>
$this
,
'link'
=>
[
'id'
=>
'id'
],
'multiple'
=>
false
,
];
return
new
ActiveQuery
(
$config
);
]);
}
}
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