diff options
author | Ivan Enderlin <ivan.enderlin@hoa-project.net> | 2013-04-23 15:34:31 +0200 |
---|---|---|
committer | Ivan Enderlin <ivan.enderlin@hoa-project.net> | 2013-04-23 15:34:31 +0200 |
commit | 057439b846af197af8f15e19c4b7adac8bf589ef (patch) | |
tree | ca3dd3f816e41262fbc5d3ab09618896375ec6f7 /Model | |
parent | 3f09de1f24a8eae56f9dd9c3f9169f621d153da1 (diff) | |
download | Praspel-057439b846af197af8f15e19c4b7adac8bf589ef.zip Praspel-057439b846af197af8f15e19c4b7adac8bf589ef.tar.gz Praspel-057439b846af197af8f15e19c4b7adac8bf589ef.tar.bz2 |
New interfaces for the @throwable clause.
The @throwable clause implements IteratorAggregate and Countable.
Diffstat (limited to 'Model')
-rw-r--r-- | Model/Throwable.php | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/Model/Throwable.php b/Model/Throwable.php index e09757c..f0f639c 100644 --- a/Model/Throwable.php +++ b/Model/Throwable.php @@ -57,7 +57,7 @@ namespace Hoa\Praspel\Model { * @license New BSD License */ -class Throwable extends Clause { +class Throwable extends Clause implements \IteratorAggregate, \Countable { /** * Name. @@ -99,6 +99,28 @@ class Throwable extends Clause { return $this->_exceptions; } + + /** + * Iterator over exceptions. + * + * @access public + * @return \ArrayIterator + */ + public function getIterator ( ) { + + return new \ArrayIterator($this->getExceptions()); + } + + /** + * Count number of exceptions. + * + * @access public + * @return int + */ + public function count ( ) { + + return count($this->getExceptions()); + } } } |