summaryrefslogtreecommitdiff
path: root/framework/Caching/TCacheDependencyList.php
diff options
context:
space:
mode:
authorFabio Bas <ctrlaltca@gmail.com>2015-01-20 19:19:55 +0100
committerFabio Bas <ctrlaltca@gmail.com>2015-01-20 19:19:55 +0100
commitd45b5615d48bff5373a6cda0728cb26332c3d962 (patch)
tree85f6e6d62317a66daa62745347a7636b1ca49546 /framework/Caching/TCacheDependencyList.php
parent7b843cc7df910a218272f328293f2541d53c23b2 (diff)
One class per file: framework/Caching/
Diffstat (limited to 'framework/Caching/TCacheDependencyList.php')
-rw-r--r--framework/Caching/TCacheDependencyList.php42
1 files changed, 42 insertions, 0 deletions
diff --git a/framework/Caching/TCacheDependencyList.php b/framework/Caching/TCacheDependencyList.php
new file mode 100644
index 00000000..d74ce060
--- /dev/null
+++ b/framework/Caching/TCacheDependencyList.php
@@ -0,0 +1,42 @@
+<?php
+/**
+ * TCache and cache dependency classes.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2014 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @package System.Caching
+ */
+
+/**
+ * TCacheDependencyList class.
+ *
+ * TCacheDependencyList represents a list of cache dependency objects.
+ * Only objects implementing {@link ICacheDependency} can be added into this list.
+ *
+ * TCacheDependencyList can be used like an array. See {@link TList}
+ * for more details.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @package System.Caching
+ * @since 3.1.0
+ */
+class TCacheDependencyList extends TList
+{
+ /**
+ * Inserts an item at the specified position.
+ * This overrides the parent implementation by performing additional type checking
+ * for each newly added item.
+ * @param integer the specified position.
+ * @param mixed new item
+ * @throws TInvalidDataTypeException if the item to be inserted is not a dependency instance
+ */
+ public function insertAt($index,$item)
+ {
+ if($item instanceof ICacheDependency)
+ parent::insertAt($index,$item);
+ else
+ throw new TInvalidDataTypeException('cachedependencylist_cachedependency_required');
+ }
+} \ No newline at end of file