Commit ce1e4697 by Alexander Kochetov

ActiveQuery::one() slight refactoring

parent 0c02edbf
...@@ -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