Ejemplo n.º 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->key);
     $requestUrl = $this->owningLibrary->apiRequestString($config);
     $response = $this->owningLibrary->_request($requestUrl, 'GET');
     //load response into item objects
     $respArray = $response->parseResponseBody();
     $fetchedItems = $this->owningLibrary->items->addItemsFromJson($respArray);
     return $fetchedItems;
 }