summaryrefslogtreecommitdiffstats
path: root/dependencyinjection
diff options
context:
space:
mode:
authorBernhard Posselt <nukeawhale@gmail.com>2013-03-20 23:33:51 +0100
committerBernhard Posselt <nukeawhale@gmail.com>2013-03-21 00:31:48 +0100
commit964383cc7a74078dab9e80aeed2c226992087c1c (patch)
treea2ed04b6a81f389e2606b9c3b6da2ec8dc1a853a /dependencyinjection
parentef2af010a63bfcf511cdf648e9358a3956d97739 (diff)
welcome in the age of newness
Diffstat (limited to 'dependencyinjection')
-rw-r--r--dependencyinjection/dicontainer.php70
1 files changed, 70 insertions, 0 deletions
diff --git a/dependencyinjection/dicontainer.php b/dependencyinjection/dicontainer.php
new file mode 100644
index 000000000..874360b9c
--- /dev/null
+++ b/dependencyinjection/dicontainer.php
@@ -0,0 +1,70 @@
+<?php
+
+/**
+* ownCloud - News
+*
+* @author Alessandro Cosentino
+* @author Bernhard Posselt
+* @copyright 2012 Alessandro Cosentino cosenal@gmail.com
+* @copyright 2012 Bernhard Posselt nukeawhale@gmail.com
+*
+* This library is free software; you can redistribute it and/or
+* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
+* License as published by the Free Software Foundation; either
+* version 3 of the License, or any later version.
+*
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
+*
+* You should have received a copy of the GNU Affero General Public
+* License along with this library. If not, see <http://www.gnu.org/licenses/>.
+*
+*/
+
+namespace OCA\News\DependencyInjection;
+
+use OCA\AppFramework\DependencyInjection\DIContainer as BaseContainer;
+
+use OCA\News\Controller\FolderController;
+use OCA\News\Bl\FolderBl;
+use OCA\News\Db\FolderMapper;
+
+
+class DIContainer extends BaseContainer {
+
+
+ /**
+ * Define your dependencies in here
+ */
+ public function __construct(){
+ // tell parent container about the app name
+ parent::__construct('news');
+
+
+ /**
+ * CONTROLLERS
+ */
+ $this['FolderController'] = $this->share(function($c){
+ return new FolderController($c['API'], $c['Request'], $c['FolderBl']);
+ });
+
+ /**
+ * Business
+ */
+ $this['FolderBl'] = $this->share(function($c){
+ return new FolderBl($c['FolderMapper']);
+ });
+
+ /**
+ * MAPPERS
+ */
+ $this['FolderMapper'] = $this->share(function($c){
+ return new FolderMapper($c['API']);
+ });
+
+
+ }
+}
+