diff options
author | Alessandro Cosentino <cosenal@gmail.com> | 2013-03-06 10:27:50 +0100 |
---|---|---|
committer | Alessandro Cosentino <cosenal@gmail.com> | 2013-03-06 10:27:50 +0100 |
commit | 3c87c2be39c609a3d68c133358ab91a40480b745 (patch) | |
tree | 0fa508a1552c34ef55ab9cfbd175d2fc5af4c8f6 /external_api/folder.php | |
parent | c4349e0c2ee6a6600b8e661e776c2e1a4b131e0e (diff) |
api calls are anonymous functions now
Diffstat (limited to 'external_api/folder.php')
-rw-r--r-- | external_api/folder.php | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/external_api/folder.php b/external_api/folder.php index f9dae7535..66e5f3915 100644 --- a/external_api/folder.php +++ b/external_api/folder.php @@ -4,12 +4,14 @@ namespace OCA\News; use \OCA\News\Controller\FolderController; -class API_Folder { +class FolderApi { - public static function getAll() { - $container = createDIContainer(); - $bl = $container['FolderBL']; - $folders = $bl->getAll(); + public function __construct($bl){ + $this->bl = $bl; + } + + public function getAll() { + $folders = $this->bl->getAll(); $serializedFolders = array(); //TODO: check the behaviour for nested folders @@ -19,14 +21,12 @@ class API_Folder { return new \OC_OCS_Result($serializedFolders); } - public static function create() { + public function create() { $name = $_POST['name']; $parentId = $_POST['parentid']; - $container = createDIContainer(); - $bl = $container['FolderBL']; - $bl->create($name, $parentId); + $this->bl->create($name, $parentId); return new \OC_OCS_Result(); } |