summaryrefslogtreecommitdiff
path: root/framework/Web/UI/WebControls/TRepeater.php
diff options
context:
space:
mode:
authorxue <>2006-01-31 00:01:49 +0000
committerxue <>2006-01-31 00:01:49 +0000
commit01bc363ac789cfb9d644ce82a949da5cd7e1c220 (patch)
treea059046856645d59cf0cb1badee83eb5c73671e9 /framework/Web/UI/WebControls/TRepeater.php
parent265b7e85766ba403ca0a8b58648dd091e483cf38 (diff)
Modified TList and TMap implementation so that they can be more easily extended.
Diffstat (limited to 'framework/Web/UI/WebControls/TRepeater.php')
-rw-r--r--framework/Web/UI/WebControls/TRepeater.php17
1 files changed, 10 insertions, 7 deletions
diff --git a/framework/Web/UI/WebControls/TRepeater.php b/framework/Web/UI/WebControls/TRepeater.php
index 6aa6b461..a122f387 100644
--- a/framework/Web/UI/WebControls/TRepeater.php
+++ b/framework/Web/UI/WebControls/TRepeater.php
@@ -661,15 +661,18 @@ class TRepeaterItem extends TControl implements INamingContainer
class TRepeaterItemCollection extends TList
{
/**
- * Returns true only when the item to be added is a {@link TRepeaterItem}.
- * This method is invoked before adding an item to the list.
- * If it returns true, the item will be added to the list, otherwise not.
- * @param mixed item to be added
- * @return boolean whether the item can be added to the list
+ * Inserts an item at the specified position.
+ * This overrides the parent implementation by inserting only TRepeaterItem.
+ * @param integer the speicified position.
+ * @param mixed new item
+ * @throws TInvalidDataTypeException if the item to be inserted is not a TRepeaterItem.
*/
- protected function canAddItem($item)
+ public function insertAt($index,$item)
{
- return ($item instanceof TRepeaterItem);
+ if($item instanceof TRepeaterItem)
+ parent::insertAt($index,$item);
+ else
+ throw new TInvalidDataTypeException('repeateritemcollection_repeateritem_required');
}
}