CampContext::__get PHP Method

__get() final public method

Overloaded method call to give access to context properties.
final public __get ( string $p_element ) : mix
$p_element string - the property name
return mix - the property value
    public final function __get($p_element)
    {
        try {
            $p_element = CampContext::TranslateProperty($p_element);
            // Verify if an object of this type exists
            if (!is_null(CampContext::ObjectType($p_element))) {
                if (!isset($this->m_objects[$p_element]) || is_null($this->m_objects[$p_element])) {
                    $this->createObject($p_element);
                }
                return $this->m_objects[$p_element];
            }
            // Verify if a readonly property with this name exists
            if (is_array($this->m_readonlyProperties) && array_key_exists($p_element, $this->m_readonlyProperties)) {
                return $this->m_readonlyProperties[$p_element];
            }
            // Verify if a property with this name exists
            if (is_array($this->m_properties) && array_key_exists($p_element, $this->m_properties)) {
                return $this->m_properties[$p_element];
            }
            // No object of this type of property with this name exist.
            $this->trigger_invalid_property_error($p_element);
        } catch (InvalidObjectException $e) {
            $this->trigger_invalid_object_error($e->getClassName());
        }
        return null;
    }