From 1ae09931b2572d9c3067c99f841a60cb3330b3f3 Mon Sep 17 00:00:00 2001 From: wei <> Date: Thu, 3 May 2007 00:48:04 +0000 Subject: Update active relations docs --- .../ActiveRecord/Relations/TActiveRecordRelationContext.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'framework/Data/ActiveRecord/Relations/TActiveRecordRelationContext.php') diff --git a/framework/Data/ActiveRecord/Relations/TActiveRecordRelationContext.php b/framework/Data/ActiveRecord/Relations/TActiveRecordRelationContext.php index 033d7638..167c90a5 100644 --- a/framework/Data/ActiveRecord/Relations/TActiveRecordRelationContext.php +++ b/framework/Data/ActiveRecord/Relations/TActiveRecordRelationContext.php @@ -57,11 +57,14 @@ class TActiveRecordRelationContext if(!isset($statics[self::RELATIONS_CONST])) throw new TActiveRecordException('ar_relations_undefined', get_class($this->_sourceRecord), self::RELATIONS_CONST); - if(isset($statics[self::RELATIONS_CONST][$property])) - return $statics[self::RELATIONS_CONST][$property]; - else - throw new TActiveRecordException('ar_undefined_relation_prop', - $property, get_class($this->_sourceRecord), self::RELATIONS_CONST); + $property = strtolower($property); + foreach($statics[self::RELATIONS_CONST] as $name => $relation) + { + if(strtolower($name)===$property) + return $relation; + } + throw new TActiveRecordException('ar_undefined_relation_prop', + $property, get_class($this->_sourceRecord), self::RELATIONS_CONST); } /** -- cgit v1.2.3