From 550ba06593b467b643862d41a00ca2dd12ee704b Mon Sep 17 00:00:00 2001 From: xue <> Date: Wed, 2 Aug 2006 02:24:29 +0000 Subject: merge from 3.0 branch till 1320. --- framework/Collections/TStack.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'framework/Collections/TStack.php') diff --git a/framework/Collections/TStack.php b/framework/Collections/TStack.php index 79d17902..f1118d90 100644 --- a/framework/Collections/TStack.php +++ b/framework/Collections/TStack.php @@ -31,7 +31,7 @@ * @package System.Collections * @since 3.0 */ -class TStack extends TComponent implements IteratorAggregate +class TStack extends TComponent implements IteratorAggregate,Countable { /** * internal data storage @@ -160,6 +160,16 @@ class TStack extends TComponent implements IteratorAggregate { return $this->_c; } + + /** + * Returns the number of items in the stack. + * This method is required by Countable interface. + * @return integer number of items in the stack. + */ + public function count() + { + return $this->getCount(); + } } /** -- cgit v1.2.3