From ad43cf5576235b11bf8df3ead4ee9feb6e44e593 Mon Sep 17 00:00:00 2001 From: bethrezen Date: Sat, 7 Feb 2015 11:49:47 +0300 Subject: [PATCH] :exclamation: Fixes #9 but beware! Can cause side-effects: we are returning Query instead of calling `->one()` or `->all()` --- ActiveRecord.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ActiveRecord.php b/ActiveRecord.php index 395322b..bd4abec 100644 --- a/ActiveRecord.php +++ b/ActiveRecord.php @@ -254,7 +254,7 @@ abstract class ActiveRecord extends BaseActiveRecord return \Yii::$app->get('arangodb'); } - protected static function findByCondition($condition, $one) + protected static function findByCondition($condition) { /** @var ActiveQuery $query */ $query = static::find(); @@ -270,7 +270,7 @@ abstract class ActiveRecord extends BaseActiveRecord } } - return $one ? $query->andWhere($condition)->one() : $query->andWhere($condition)->all(); + return $query->andWhere($condition); } /**