catalog_id = $catalog_id; } public function getChildren() { $children = array(); $catalogs = null; if ($this->catalog_id > 0) { $catalogs = array(); $catalogs[] = $this->catalog_id; } $artists = Catalog::get_artists($catalogs); foreach ($artists as $artist) { $children[] = new WebDAV_Directory($artist); } return $children; } public function getChild($name) { debug_event('webdav', 'Catalog getChild', 5); $matches = Catalog::search_childrens($name, $this->catalog_id); // 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]); return null; } public function childExists($name) { $matches = Catalog::search_childrens($name, $this->catalog_id); return (count($matches) > 0); } public function getName() { if ($this->catalog_id > 0) { $catalog = Catalog::create_from_id($this->catalog_id); return $catalog->name; } return AmpConfig::get('site_title'); } }