summaryrefslogtreecommitdiff
path: root/app/Subscriber/Base.php
diff options
context:
space:
mode:
authorFrédéric Guillot <fred@kanboard.net>2014-12-27 19:10:38 -0500
committerFrédéric Guillot <fred@kanboard.net>2014-12-27 19:10:38 -0500
commit17dc5bdc9ede52ad618bbf326e67e3b6988170f7 (patch)
tree9cf4d325667f11fa735bca84042fb385e3273329 /app/Subscriber/Base.php
parentcf821e117ce8b937cff7f386a107aaa81ba6bf9b (diff)
Move events handling to Symfony\EventDispatcher
Diffstat (limited to 'app/Subscriber/Base.php')
-rw-r--r--app/Subscriber/Base.php47
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];
+ }
+}