From 964383cc7a74078dab9e80aeed2c226992087c1c Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Wed, 20 Mar 2013 23:33:51 +0100 Subject: welcome in the age of newness --- dependencyinjection/dicontainer.php | 70 +++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 dependencyinjection/dicontainer.php (limited to 'dependencyinjection/dicontainer.php') 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 @@ +. +* +*/ + +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']); + }); + + + } +} + -- cgit v1.2.3