$value) { $target->$name = $array->get($name); } } function basePath () { if ( ! $this->base) $this->base = $this->getBasePath(); return $this->base; } function findAll (Collection $request, $id = null) { require_once "core/settings.php"; require_once "core/path.php"; $this->reference = $id; $base = $this->basePath (); $path = new Path($base); $list = $path->getContent(); $result = array (); $this->count = 0; foreach ($list as $name) { if (is_dir (Path::join($this->basePath (), $name)) && $module = $this->findById ($name)) { $this->count++; $result [] = $module; } } return $result; } function findById ($name) { $file = Path::join($this->basePath(), $this->getSettingsFile ($name)); if (file_exists($file)) { $settings = new Settings($file); $settings->read(); return $this->settingsMap($name, $settings); } return null; } /** * Число папок */ function getCount () { return $this->count; } /** * Удаление списка папок */ function deleteList(array $list) { foreach ($list as $name) Path::delete(Path::join($this->getBasePath(), $name)); } } ?>