diff options
Diffstat (limited to 'app/Subscriber/Base.php')
-rw-r--r-- | app/Subscriber/Base.php | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/app/Subscriber/Base.php b/app/Subscriber/Base.php new file mode 100644 index 00000000..1ed15327 --- /dev/null +++ b/app/Subscriber/Base.php @@ -0,0 +1,47 @@ +<?php + +namespace Subscriber; + +use Event\TaskEvent; +use Model\Task; +use Pimple\Container; + +/** + * Base subscriber class + * + * @package subscriber + * @author Frederic Guillot + */ +abstract class Base +{ + /** + * Container instance + * + * @access protected + * @var \Pimple\Container + */ + protected $container; + + /** + * Constructor + * + * @access public + * @param \Pimple\Container $container + */ + public function __construct(Container $container) + { + $this->container = $container; + } + + /** + * Load automatically models + * + * @access public + * @param string $name Model name + * @return mixed + */ + public function __get($name) + { + return $this->container[$name]; + } +} |