aboutsummaryrefslogtreecommitdiffstats
path: root/Model/Collection.php
diff options
context:
space:
mode:
authorIvan Enderlin <ivan.enderlin@hoa-project.net>2013-04-17 14:09:01 +0200
committerIvan Enderlin <ivan.enderlin@hoa-project.net>2013-04-17 14:09:01 +0200
commit359c00991c29537c2593fcaec0bf24bca14ae72d (patch)
tree598b791e86f965b909dc457ada6e85120184ff93 /Model/Collection.php
parenta47252b81b7f6cb207b27fb4ae3f290d0496c3ea (diff)
downloadPraspel-359c00991c29537c2593fcaec0bf24bca14ae72d.zip
Praspel-359c00991c29537c2593fcaec0bf24bca14ae72d.tar.gz
Praspel-359c00991c29537c2593fcaec0bf24bca14ae72d.tar.bz2
Add the Countable interface to Collection.
Diffstat (limited to 'Model/Collection.php')
-rw-r--r--Model/Collection.php14
1 files changed, 13 insertions, 1 deletions
diff --git a/Model/Collection.php b/Model/Collection.php
index 72df0ca..9a0242b 100644
--- a/Model/Collection.php
+++ b/Model/Collection.php
@@ -65,7 +65,8 @@ namespace Hoa\Praspel\Model {
class Collection
implements \Hoa\Visitor\Element,
\ArrayAccess,
- \IteratorAggregate {
+ \IteratorAggregate,
+ \Countable {
/**
* Clauses.
@@ -211,6 +212,17 @@ class Collection
}
/**
+ * Count number of clauses.
+ *
+ * @access public
+ * @return int
+ */
+ public function count ( ) {
+
+ return count($this->_clauses);
+ }
+
+ /**
* Accept a visitor.
*
* @access public