Exemple #1
0
 /**
  * @param string $name
  *
  * @return mixed|null
  * @throws SettingException
  */
 public function __get($name)
 {
     switch ($name) {
         case 'container':
             $class_name = 'Hametuha\\HamePub\\MetaInf\\' . ucfirst($name);
             return $class_name::get($this->id);
             break;
         case 'parser':
             return HTML5Parser::get($this->id);
             break;
         case 'opf':
             return Content::get($this->id);
             break;
         case 'toc':
             return Toc::get($this->id) ?: Toc::init($this->id, 'Index');
             break;
         case 'distributor':
             return Distributor::get($this->id);
             break;
         default:
             return null;
             break;
     }
 }