OneSignal\OneSignal::__get PHP Method

__get() public method

Create required services on the fly.
public __get ( string $name ) : object
$name string
return object
    public function __get($name)
    {
        if (in_array($name, ['apps', 'devices', 'notifications'], true)) {
            if (isset($this->services[$name])) {
                return $this->services[$name];
            }
            $serviceName = __NAMESPACE__ . '\\' . ucfirst($name);
            $this->services[$name] = new $serviceName($this);
            return $this->services[$name];
        }
        $trace = debug_backtrace();
        throw new OneSignalException(sprintf('Undefined property via __get(): %s in %s on line %u', $name, $trace[0]['file'], $trace[0]['line']));
    }