From a823cc1d08535539f850711c0b9edb5b648f1960 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sat, 23 Jul 2016 14:50:59 -0400 Subject: NotificationModel refactoring --- app/EventBuilder/EventIteratorBuilder.php | 48 +++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 app/EventBuilder/EventIteratorBuilder.php (limited to 'app/EventBuilder/EventIteratorBuilder.php') diff --git a/app/EventBuilder/EventIteratorBuilder.php b/app/EventBuilder/EventIteratorBuilder.php new file mode 100644 index 00000000..afa146b6 --- /dev/null +++ b/app/EventBuilder/EventIteratorBuilder.php @@ -0,0 +1,48 @@ +builders[] = $builder; + return $this; + } + + public function rewind() { + $this->position = 0; + } + + /** + * @return BaseEventBuilder + */ + public function current() { + return $this->builders[$this->position]; + } + + public function key() { + return $this->position; + } + + public function next() { + ++$this->position; + } + + public function valid() { + return isset($this->builders[$this->position]); + } +} -- cgit v1.2.3