Esempio n. 1
0
 /**
  * @brief Returns the forest (list of trees) of folders children of $parentid,
  *		 including the feeds that they contain
  * @param
  * @returns
  */
 public function childrenOfWithFeeds($parentid)
 {
     $feedmapper = new FeedMapper();
     $collectionlist = $feedmapper->findByFolderId($parentid);
     $stmt = \OCP\DB::prepare('SELECT * FROM ' . self::tableName . ' WHERE user_id = ? AND parent_id = ?');
     $result = $stmt->execute(array($this->userid, $parentid));
     while ($row = $result->fetchRow()) {
         $folderid = $row['id'];
         $folder = new Folder($row['name'], $folderid);
         $folder->setOpened($row['opened']);
         $children = self::childrenOfWithFeeds($folderid);
         $folder->addChildren($children);
         $collectionlist[] = $folder;
     }
     return $collectionlist;
 }