Commit a0240daa by Qiang Xue

Merge pull request #3658 from creocoder/activequery-one-refactoring

ActiveQuery::one() slight refactoring
parents 0c02edbf ce1e4697
...@@ -223,8 +223,7 @@ class ActiveQuery extends Query implements ActiveQueryInterface ...@@ -223,8 +223,7 @@ class ActiveQuery extends Query implements ActiveQueryInterface
*/ */
public function one($db = null) public function one($db = null)
{ {
$command = $this->createCommand($db); $row = parent::one($db);
$row = $command->queryOne();
if ($row !== false) { if ($row !== false) {
if ($this->asArray) { if ($this->asArray) {
$model = $row; $model = $row;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment