Пример #1
0
 public function getChild($name)
 {
     debug_event('webdav', 'Catalog getChild for `' . $name . '`', 5);
     $matches = Catalog::search_childrens($name, $this->catalog_id);
     debug_event('webdav', 'Found ' . count($matches) . ' childs.', 5);
     // Always return first match
     // Warning: this means that two items with the same name will not be supported for now
     if (count($matches) > 0) {
         return WebDAV_Directory::getChildFromArray($matches[0]);
     }
     throw new DAV\Exception\NotFound('The artist with name: ' . $name . ' could not be found');
 }
Пример #2
0
 public function getChild($name)
 {
     // Clean song name
     if (strtolower(get_class($this->libitem)) === "album") {
         $splitname = explode('-', $name, 3);
         $name = trim($splitname[count($splitname) - 1]);
         $nameinfo = pathinfo($name);
         $name = $nameinfo['filename'];
     }
     debug_event('webdav', 'Directory getChild: ' . $name, 5);
     $matches = $this->libitem->search_childrens($name);
     // Always return first match
     // Warning: this means that two items with the same name will not be supported for now
     if (count($matches) > 0) {
         return WebDAV_Directory::getChildFromArray($matches[0]);
     }
     throw new DAV\Exception\NotFound('The child with name: ' . $name . ' could not be found');
 }