Exemple #1
0
 public function getChildren()
 {
     //short circuit if has item has no children
     if (!$this->numChildren) {
         //} || (this.parentItemKey !== false)){
         return array();
     }
     $config = array('target' => 'children', 'libraryType' => $this->owningLibrary->libraryType, 'libraryID' => $this->owningLibrary->libraryID, 'itemKey' => $this->itemKey, 'content' => 'json');
     $requestUrl = $this->owningLibrary->apiRequestString($config);
     $response = $this->owningLibrary->_request($requestUrl, 'GET');
     //load response into item objects
     $fetchedItems = array();
     if ($response->isError()) {
         return false;
         throw new Exception("Error fetching items");
     }
     $feed = new Zotero_Feed($response->getRawBody());
     $fetchedItems = $this->owningLibrary->items->addItemsFromFeed($feed);
     return $fetchedItems;
 }