blob: 0ddd8ac803869b1ea92e8cf1c44517b98160459b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
<?php
namespace OCA\News;
class FeedBl {
public function __construct($feedMapper){
$this->feedMapper = $feedMapper;
}
public function getAll() {
return $this->feedMapper->findAll();
}
public function getById($feedid) {
return $this->feedMapper->findById($feedid);
}
public function create($url, $folderid) {
$feed = new Feed($url);
$this->feedMapper->save($feed, $folderid);
$feed = Utils::fetch($url);
if ($feed != null) {
$this->feedMapper->save($feed, $folderid);
}
return true;
}
}
|