diff options
author | xue <> | 2006-01-31 00:01:49 +0000 |
---|---|---|
committer | xue <> | 2006-01-31 00:01:49 +0000 |
commit | 01bc363ac789cfb9d644ce82a949da5cd7e1c220 (patch) | |
tree | a059046856645d59cf0cb1badee83eb5c73671e9 /framework/Security/TAuthorizationRule.php | |
parent | 265b7e85766ba403ca0a8b58648dd091e483cf38 (diff) |
Modified TList and TMap implementation so that they can be more easily extended.
Diffstat (limited to 'framework/Security/TAuthorizationRule.php')
-rw-r--r-- | framework/Security/TAuthorizationRule.php | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/framework/Security/TAuthorizationRule.php b/framework/Security/TAuthorizationRule.php index 2ee6de49..81955a44 100644 --- a/framework/Security/TAuthorizationRule.php +++ b/framework/Security/TAuthorizationRule.php @@ -200,13 +200,19 @@ class TAuthorizationRuleCollection extends TList }
/**
- * Ensures that only instance of TAuthorizationRule is added to the collection.
- * @param mixed item to be added to the collection
- * @return boolean whether the item can be added to the collection
- */
- protected function canAddItem($item)
+ * Inserts an item at the specified position.
+ * This overrides the parent implementation by performing additional
+ * operations for each newly added TAuthorizationRule object.
+ * @param integer the speicified position.
+ * @param mixed new item
+ * @throws TInvalidDataTypeException if the item to be inserted is not a TAuthorizationRule object.
+ */
+ public function insertAt($index,$item)
{
- return ($item instanceof TAuthorizationRule);
+ if($item instanceof TAuthorizationRule)
+ parent::insertAt($index,$item);
+ else
+ throw new TInvalidDataTypeException('authorizationrulecollection_authorizationrule_required');
}
}
|