diff options
author | Alessandro Cosentino <cosenal@gmail.com> | 2013-03-03 11:06:00 +0100 |
---|---|---|
committer | Alessandro Cosentino <cosenal@gmail.com> | 2013-03-03 11:06:00 +0100 |
commit | 0852773340ed26ecc8faa8e61192f38132673bc6 (patch) | |
tree | d5727c17955fb2e2f0d96f58717d819e75762bcf /external_api | |
parent | 4902253e9c8aac706091c6337391153b02923689 (diff) |
adds a call to create feed
Diffstat (limited to 'external_api')
-rw-r--r-- | external_api/feed.php | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/external_api/feed.php b/external_api/feed.php index d23f77e01..dba518b7a 100644 --- a/external_api/feed.php +++ b/external_api/feed.php @@ -16,4 +16,30 @@ class API_Feed { } return new \OC_OCS_Result($serializedFeeds); } + + public static function getById($parameters) { + $feedid = $parameters['feedid']; + $container = createDIContainer(); + $bl = $container['FeedBL']; + $feed = $bl->getById($feedid); + $serializedFeed = array($feed->jsonSerialize()); + return new \OC_OCS_Result($serializedFeed); + } + + public static function create() { + + $url = $_POST['url']; + $folderId = $_POST['folderId']; + + $container = createDIContainer(); + $bl = $container['FeedBL']; + $success = $bl->create($url, $folderId); + + if ($success) { + return new OC_OCS_Result(); + } + else { + return new OC_OCS_Result(null, 101); + } + } } |