diff options
author | Bernhard Posselt <nukeawhale@gmail.com> | 2013-03-20 23:33:51 +0100 |
---|---|---|
committer | Bernhard Posselt <nukeawhale@gmail.com> | 2013-03-20 23:33:51 +0100 |
commit | d72f8d55d8eeb6e16301da3d2906d8e3df22de3e (patch) | |
tree | a2ed04b6a81f389e2606b9c3b6da2ec8dc1a853a /dependencyinjection/dicontainer.php | |
parent | a1fb325f85af12e2eea90edb70fedcaf8d9d62ca (diff) |
welcome in the age of newness
Diffstat (limited to 'dependencyinjection/dicontainer.php')
-rw-r--r-- | dependencyinjection/dicontainer.php | 70 |
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']); + }); + + + } +} + |