diff options
Diffstat (limited to 'app/Subscriber/BaseSubscriber.php')
-rw-r--r-- | app/Subscriber/BaseSubscriber.php | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/app/Subscriber/BaseSubscriber.php b/app/Subscriber/BaseSubscriber.php new file mode 100644 index 00000000..875c5e26 --- /dev/null +++ b/app/Subscriber/BaseSubscriber.php @@ -0,0 +1,40 @@ +<?php + +namespace Kanboard\Subscriber; + +use Kanboard\Core\Base; + +/** + * Base class for subscribers + * + * @package subscriber + * @author Frederic Guillot + */ +class BaseSubscriber extends Base +{ + /** + * Method called + * + * @access private + * @var array + */ + private $called = array(); + + /** + * Check if a method has been executed + * + * @access public + * @param string $method + * @return boolean + */ + public function isExecuted($method = '') + { + if (isset($this->called[$method])) { + return true; + } + + $this->called[$method] = true; + + return false; + } +} |