From 6133133ec0a142114dcde040b962fee8cb9eae43 Mon Sep 17 00:00:00 2001 From: Carsten Brandt Date: Wed, 25 Sep 2013 12:26:40 +0200 Subject: [PATCH] added dependency in db\AR -> redis\AR needs to be refactored later this is to make relations work. tests are passing now. refactoring needed to remove the dependency --- framework/yii/db/ActiveRecord.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/framework/yii/db/ActiveRecord.php b/framework/yii/db/ActiveRecord.php index 99fabff..262ceed 100644 --- a/framework/yii/db/ActiveRecord.php +++ b/framework/yii/db/ActiveRecord.php @@ -386,7 +386,7 @@ class ActiveRecord extends Model return $this->_related[$t]; } $value = parent::__get($name); - if ($value instanceof ActiveRelation) { + if ($value instanceof ActiveRelation || $value instanceof \yii\redis\ActiveRelation) { // TODO this should be done differently remove dep on redis return $this->_related[$t] = $value->multiple ? $value->all() : $value->one(); } else { return $value; @@ -1272,7 +1272,7 @@ class ActiveRecord extends Model $getter = 'get' . $name; try { $relation = $this->$getter(); - if ($relation instanceof ActiveRelation) { + if ($relation instanceof ActiveRelation || $relation instanceof \yii\redis\ActiveRelation) { // TODO this should be done differently remove dep on redis return $relation; } } catch (UnknownMethodException $e) {