mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-16 06:17:56 +08:00
Merge pull request #3658 from creocoder/activequery-one-refactoring
ActiveQuery::one() slight refactoring
This commit is contained in:
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user