Example #1
0
 /**
  * Magic utility factory.
  *
  * @since 150424 Initial release.
  *
  * @param string $property Property.
  *
  * @return mixed Overloaded property value.
  */
 public function __get(string $property)
 {
     $map = $this->map($property);
     $class = Classes::class . $map['sub_namespace'] . '\\Utils\\' . $map['prop_meth'];
     $class = $this->App->getClass($class);
     if (class_exists($class)) {
         $Utility = $this->App->Di->get($class, [], true);
         $this->overload((object) [$property => $Utility], true);
         return $Utility;
     }
     return parent::__get($property);
 }