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
7a81110f
Commit
7a81110f
authored
Dec 17, 2013
by
Carsten Brandt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make ActiveRelation reusable
fixes #1560
parent
089eeaa5
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
ActiveRelation.php
framework/yii/db/ActiveRelation.php
+4
-0
No files found.
framework/yii/db/ActiveRelation.php
View file @
7a81110f
...
@@ -63,6 +63,7 @@ class ActiveRelation extends ActiveQuery implements ActiveRelationInterface
...
@@ -63,6 +63,7 @@ class ActiveRelation extends ActiveQuery implements ActiveRelationInterface
public
function
createCommand
(
$db
=
null
)
public
function
createCommand
(
$db
=
null
)
{
{
if
(
$this
->
primaryModel
!==
null
)
{
if
(
$this
->
primaryModel
!==
null
)
{
$where
=
$this
->
where
;
// lazy loading
// lazy loading
if
(
$this
->
via
instanceof
self
)
{
if
(
$this
->
via
instanceof
self
)
{
// via pivot table
// via pivot table
...
@@ -84,6 +85,9 @@ class ActiveRelation extends ActiveQuery implements ActiveRelationInterface
...
@@ -84,6 +85,9 @@ class ActiveRelation extends ActiveQuery implements ActiveRelationInterface
}
else
{
}
else
{
$this
->
filterByModels
([
$this
->
primaryModel
]);
$this
->
filterByModels
([
$this
->
primaryModel
]);
}
}
$command
=
parent
::
createCommand
(
$db
);
$this
->
where
=
$where
;
return
$command
;
}
}
return
parent
::
createCommand
(
$db
);
return
parent
::
createCommand
(
$db
);
}
}
...
...
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