diff options
author | Alessandro Cosentino <cosenal@gmail.com> | 2012-06-30 20:02:00 -0400 |
---|---|---|
committer | Alessandro Cosentino <cosenal@gmail.com> | 2012-06-30 20:02:00 -0400 |
commit | f8f6fd3d778fe95bac15e52747ff5b1f6461c136 (patch) | |
tree | a6a895d6f356641d6c5263d64cd3853ad9a0f794 /lib/foldermapper.php | |
parent | 6f3404ee971a130b90cf1773b9e67f4feef0be74 (diff) |
shows folder list
Diffstat (limited to 'lib/foldermapper.php')
-rw-r--r-- | lib/foldermapper.php | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/lib/foldermapper.php b/lib/foldermapper.php index 97b146dcd..925726ab8 100644 --- a/lib/foldermapper.php +++ b/lib/foldermapper.php @@ -39,11 +39,22 @@ class OC_News_FolderMapper { } /** - * @brief Retrieve a feed from the database - * @param id The id of the feed in the database table. - * @returns + * @brief Retrieve a folder from the database + * @param id The id of the folder in the database table. + * @returns an instance of OC_News_Folder */ public function find($id){ + $stmt = OCP\DB::prepare('SELECT * + FROM ' . self::tableName . + ' WHERE user_id = ? AND id = ?'); + $result = $stmt->execute(array($this->userid, 0)); + + while( $row = $result->fetchRow()){ + $child = new OC_News_Folder($row['name'], $row['id']); + $root->addChild($child); + } + + return $root; } /** |