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
4222c9d0
Commit
4222c9d0
authored
Mar 01, 2012
by
Qiang Xue
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of git.yiisoft.com:yii2
Conflicts: framework/db/ar/ActiveFinder.php framework/db/ar/ActiveQuery.php
parents
3210a217
71fc3dbe
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
12 deletions
+9
-12
ActiveFinder.php
framework/db/ar/ActiveFinder.php
+5
-0
ActiveQuery.php
framework/db/ar/ActiveQuery.php
+4
-12
No files found.
framework/db/ar/ActiveFinder.php
View file @
4222c9d0
...
@@ -10,6 +10,7 @@
...
@@ -10,6 +10,7 @@
namespace
yii\db\ar
;
namespace
yii\db\ar
;
use
yii\base\Object
;
use
yii\base\VectorIterator
;
use
yii\base\VectorIterator
;
use
yii\db\dao\Query
;
use
yii\db\dao\Query
;
use
yii\db\Exception
;
use
yii\db\Exception
;
...
@@ -45,6 +46,10 @@ class ActiveFinder extends \yii\base\Object
...
@@ -45,6 +46,10 @@ class ActiveFinder extends \yii\base\Object
* @var \yii\db\dao\Connection
* @var \yii\db\dao\Connection
*/
*/
public
$connection
;
public
$connection
;
/**
* @var ActiveQuery
*/
public
$query
;
public
function
__construct
(
$connection
)
public
function
__construct
(
$connection
)
{
{
...
...
framework/db/ar/ActiveQuery.php
View file @
4222c9d0
...
@@ -12,6 +12,7 @@ namespace yii\db\ar;
...
@@ -12,6 +12,7 @@ namespace yii\db\ar;
use
yii\base\VectorIterator
;
use
yii\base\VectorIterator
;
use
yii\db\dao\BaseQuery
;
use
yii\db\dao\BaseQuery
;
use
yii\db\dao\Expression
;
use
yii\db\Exception
;
use
yii\db\Exception
;
/**
/**
...
@@ -155,12 +156,13 @@ class ActiveQuery extends BaseQuery implements \IteratorAggregate, \ArrayAccess,
...
@@ -155,12 +156,13 @@ class ActiveQuery extends BaseQuery implements \IteratorAggregate, \ArrayAccess,
public
function
value
()
public
function
value
()
{
{
return
0
;
$result
=
$this
->
asArray
()
->
one
();
return
$result
===
null
?
null
:
reset
(
$result
);
}
}
public
function
exists
()
public
function
exists
()
{
{
return
$this
->
select
(
array
(
'1'
))
->
asArray
(
true
)
->
one
()
!==
null
;
return
$this
->
select
(
array
(
new
Expression
(
'1'
)))
->
asArray
(
)
->
one
()
!==
null
;
}
}
/**
/**
...
@@ -294,14 +296,4 @@ class ActiveQuery extends BaseQuery implements \IteratorAggregate, \ArrayAccess,
...
@@ -294,14 +296,4 @@ class ActiveQuery extends BaseQuery implements \IteratorAggregate, \ArrayAccess,
}
}
unset
(
$this
->
records
[
$offset
]);
unset
(
$this
->
records
[
$offset
]);
}
}
protected
function
findRecords
(
$all
=
true
)
{
$finder
=
new
ActiveFinder
(
$this
->
getDbConnection
());
if
(
!
empty
(
$this
->
with
))
{
return
$finder
->
findRecordsWithRelations
();
}
else
{
return
$finder
->
findRecords
(
$this
,
$all
);
}
}
}
}
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