summaryrefslogtreecommitdiff
path: root/framework/Collections/TDummyDataSource.php
diff options
context:
space:
mode:
authorxue <>2006-08-02 02:24:29 +0000
committerxue <>2006-08-02 02:24:29 +0000
commit550ba06593b467b643862d41a00ca2dd12ee704b (patch)
tree16ad8180c2f0b96454453effff89dc236469ee4f /framework/Collections/TDummyDataSource.php
parentccfa7850dc435ae9941cde18be827b3aac550f85 (diff)
merge from 3.0 branch till 1320.
Diffstat (limited to 'framework/Collections/TDummyDataSource.php')
-rw-r--r--framework/Collections/TDummyDataSource.php12
1 files changed, 11 insertions, 1 deletions
diff --git a/framework/Collections/TDummyDataSource.php b/framework/Collections/TDummyDataSource.php
index 46e625ab..d7fee4a9 100644
--- a/framework/Collections/TDummyDataSource.php
+++ b/framework/Collections/TDummyDataSource.php
@@ -26,7 +26,7 @@
* @package System.Collections
* @since 3.0
*/
-class TDummyDataSource extends TComponent implements IteratorAggregate
+class TDummyDataSource extends TComponent implements IteratorAggregate, Countable
{
private $_count;
@@ -54,6 +54,16 @@ class TDummyDataSource extends TComponent implements IteratorAggregate
{
return new TDummyDataSourceIterator($this->_count);
}
+
+ /**
+ * Returns the number of (virtual) items in the data source.
+ * This method is required by Countable interface.
+ * @return integer number of (virtual) items in the data source.
+ */
+ public function count()
+ {
+ return $this->getCount();
+ }
}
/**