public function __get($name)
{
if (isset($this->class_map[$name])) {
$this->{$name} = new $this->class_map[$name]($this);
return $this->{$name};
}
throw new LogicException('No such property: ' . $name);
}