summaryrefslogtreecommitdiff
path: root/app/Console/Base.php
diff options
context:
space:
mode:
authorFrédéric Guillot <fred@kanboard.net>2014-11-29 12:28:35 -0500
committerFrédéric Guillot <fred@kanboard.net>2014-11-29 12:28:35 -0500
commite8fa25f9ca246fea085da46ea705a74b6de30d10 (patch)
treeabf0fd767540e89ba5cfbbb7b6cabb64c4fcbb4e /app/Console/Base.php
parentd9879161281785c8e11fd074cec98f09df94dd46 (diff)
Replace Core\Cli by Symfony\Console
Diffstat (limited to 'app/Console/Base.php')
-rw-r--r--app/Console/Base.php53
1 files changed, 53 insertions, 0 deletions
diff --git a/app/Console/Base.php b/app/Console/Base.php
new file mode 100644
index 00000000..bf93aec4
--- /dev/null
+++ b/app/Console/Base.php
@@ -0,0 +1,53 @@
+<?php
+
+namespace Console;
+
+use Core\Tool;
+use Pimple\Container;
+use Symfony\Component\Console\Command\Command;
+
+/**
+ * Base command class
+ *
+ * @package console
+ * @author Frederic Guillot
+ *
+ * @property \Model\Notification $notification
+ * @property \Model\Task $task
+ * @property \Model\TaskExport $taskExport
+ * @property \Model\TaskFinder $taskFinder
+ */
+abstract class Base extends Command
+{
+ /**
+ * Container instance
+ *
+ * @access protected
+ * @var \Pimple\Container
+ */
+ protected $container;
+
+ /**
+ * Constructor
+ *
+ * @access public
+ * @param \Pimple\Container $container
+ */
+ public function __construct(Container $container)
+ {
+ parent::__construct();
+ $this->container = $container;
+ }
+
+ /**
+ * Load automatically models
+ *
+ * @access public
+ * @param string $name Model name
+ * @return mixed
+ */
+ public function __get($name)
+ {
+ return Tool::loadModel($this->container, $name);
+ }
+}