public function HasGlobalVariable($name, $header="", $namespace="")
    {
        if(!$namespace)
        {
            $components = $this->GetComponents($name);
            
            if($components->HasNamespace())
            {
                $namespace = $components->namespace;
                $name = $components->type;
            }
        }
        
        if($header)
        {
            if($namespace)
            {
                if(isset($this->headers[$header]->namespaces[$namespace]->global_variables[$name]))
                {
                    return $this->headers[$header]->namespaces[$namespace]->global_variables[$name];
                }
            }
            else
            {
                foreach($this->headers[$header]->namespaces as $namespace_object)
                {
                    if(isset($namespace_object->global_variables[$name]))
                    {
                        return $namespace_object->global_variables[$name];
                    }
                }
            }
        }
        elseif($namespace)
        {
            foreach($this->headers as $header_object)
            {
                if(isset($header_object->namespaces[$namespace]->global_variables[$name]))
                {
                    return $header_object->namespaces[$namespace]->global_variables[$name];
                }
            }
        }
        else
        {
            foreach($this->headers as $header_object)
            {
                foreach($header_object->namespaces as $namespace_object)
                {
                    if(isset($namespace_object->global_variables[$name]))
                    {
                        return $namespace_object->global_variables[$name];
                    }
                }
            }
        }
        
        return null;
    }
public function HasGlobalVariable($name, $header="", $namespace="")
    {
        if(!$namespace)
        {
            $components = $this->GetComponents($name);
            
            if($components->HasNamespace())
            {
                $namespace = $components->namespace;
                $name = $components->type;
            }
        }
        
        if($header)
        {
            if($namespace)
            {
                if(isset($this->headers[$header]->namespaces[$namespace]->global_variables[$name]))
                {
                    return $this->headers[$header]->namespaces[$namespace]->global_variables[$name];
                }
            }
            else
            {
                foreach($this->headers[$header]->namespaces as $namespace_object)
                {
                    if(isset($namespace_object->global_variables[$name]))
                    {
                        return $namespace_object->global_variables[$name];
                    }
                }
            }
        }
        elseif($namespace)
        {
            foreach($this->headers as $header_object)
            {
                if(isset($header_object->namespaces[$namespace]->global_variables[$name]))
                {
                    return $header_object->namespaces[$namespace]->global_variables[$name];
                }
            }
        }
        else
        {
            foreach($this->headers as $header_object)
            {
                foreach($header_object->namespaces as $namespace_object)
                {
                    if(isset($namespace_object->global_variables[$name]))
                    {
                        return $namespace_object->global_variables[$name];
                    }
                }
            }
        }
        
        return null;
    }
public function HasGlobalVariable ( $ name , $ header = "" , $ namespace = "" ) { if ( ! $ namespace ) { $ components = $ this -> GetComponents ( $ name ) ; if ( $ components -> HasNamespace ( ) ) { $ namespace = $ components -> namespace ; $ name = $ components -> type ; } } if ( $ header ) { if ( $ namespace ) { if ( isset ( $ this -> headers [ $ header ] -> namespaces [ $ namespace ] -> global_variables [ $ name ] ) ) { return $ this -> headers [ $ header ] -> namespaces [ $ namespace ] -> global_variables [ $ name ] ; } } else { foreach ( $ this -> headers [ $ header ] -> namespaces as $ namespace_object ) { if ( isset ( $ namespace_object -> global_variables [ $ name ] ) ) { return $ namespace_object -> global_variables [ $ name ] ; } } } } elseif ( $ namespace ) { foreach ( $ this -> headers as $ header_object ) { if ( isset ( $ header_object -> namespaces [ $ namespace ] -> global_variables [ $ name ] ) ) { return $ header_object -> namespaces [ $ namespace ] -> global_variables [ $ name ] ; } } } else { foreach ( $ this -> headers as $ header_object ) { foreach ( $ header_object -> namespaces as $ namespace_object ) { if ( isset ( $ namespace_object -> global_variables [ $ name ] ) ) { return $ namespace_object -> global_variables [ $ name ] ; } } } } return null ; }
Check if the symbols object has a global variable.
@param string $name Name of the global variable can include
namespace separated by the :: operator or \.
@param string $header A specific header to search in.
@param string $namespace A specific namespace to search in.
@return \Peg\Lib\Definitions\Element\GlobalVariable or null if nothing found.
Check if the symbols object has a global variable .