summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAlessandro Cosentino <cosenal@gmail.com>2012-05-26 17:02:04 -0400
committerAlessandro Cosentino <cosenal@gmail.com>2012-05-26 17:02:04 -0400
commitc3fac66ea4deb1a9455c684661d73dc10d21f668 (patch)
tree5c6dfee6d27ea99c0f7b74657ef7520f10352890 /lib
parent6e91029b210cea92adc3534d9d77e008ced6e99d (diff)
remove db methods from Folder class
Diffstat (limited to 'lib')
-rw-r--r--lib/folder.php47
1 files changed, 2 insertions, 45 deletions
diff --git a/lib/folder.php b/lib/folder.php
index ead03c0e4..129110ae7 100644
--- a/lib/folder.php
+++ b/lib/folder.php
@@ -26,7 +26,8 @@
class OC_News_Folder {
private $name;
- private $feed_id;
+ private $id;
+ private $feeds;
public function __construct($name){
$this->name = $name;
@@ -40,48 +41,4 @@ class OC_News_Folder {
$this->name = $name;
}
-
-
- /**
- * @brief Save the folder into the database
- * @returns The id of the feed in the database table.
- */
- public function saveToDB() {
- $CONFIG_DBTYPE = OCP\Config::getSystemValue( "dbtype", "sqlite" );
- if( $CONFIG_DBTYPE == 'sqlite' or $CONFIG_DBTYPE == 'sqlite3' ){
- $_ut = "strftime('%s','now')";
- } elseif($CONFIG_DBTYPE == 'pgsql') {
- $_ut = 'date_part(\'epoch\',now())::integer';
- } else {
- $_ut = "UNIX_TIMESTAMP()";
- }
-
- //FIXME: Detect when user adds a known feed
- //FIXME: specify folder where you want to add
- $query = OCP\DB::prepare("
- INSERT INTO *PREFIX*news_feeds
- (url, title, added, lastmodified)
- VALUES (?, ?, $_ut, $_ut)
- ");
-
- $title = $this->get_title();
-
- if(empty($title)) {
- $l = OC_L10N::get('news');
- $title = $l->t('no title');
- }
-
- $params=array(
- htmlspecialchars_decode($this->url),
- htmlspecialchars_decode($title)
-
- //FIXME: user_id is going to move to the folder properties
- //OCP\USER::getUser()
- );
- $query->execute($params);
-
- $feed_id = OCP\DB::insertid('*PREFIX*news_feeds');
-
- return $feed_id;
- }
} \ No newline at end of file