Class: dataReflectionClass

Attributes:
Inherits:
Implements:

Contents:

Introduction

Meta Data

Attention
Attention: There is no meta data for this class.

Constants

There are no constants defined for this class.

Properties

Methods

Also See

Attention
Attention: There are no additional references for this class.

Class Syntax

In file D:\oblib-core\php\oblib\dataReflection\dataReflection.class.php between lines 45 and 158.

<?php
 
    
/**
     * 
     */

    
class dataReflectionClass extends dataObject
    
{
        
        private 
$_objReflectionClass;
        
        public function 
__construct (ReflectionClass $objReflectionClass)
        {
            
parent::__construct ('ReflectionClass');
            
            
$this->_objReflectionClass $objReflectionClass;
            
            
$this->___Push (new dataString ('Name'                    $objReflectionClass->getName ()));
            
$this->___Push (new dataBoolean ('isInternal'            $objReflectionClass->isInternal ()));
            
$this->___Push (new dataBoolean ('isUserDefined'        $objReflectionClass->isUserDefined ()));
            
$this->___Push (new dataBoolean ('isInstantiable'        $objReflectionClass->isInstantiable ()));
            
$this->___Push (new dataBoolean ('isIterateable'        $objReflectionClass->isIterateable ()));
            
$this->___Push (new dataBoolean ('isInterface'            $objReflectionClass->isInterface ()));
            
$this->___Push (new dataBoolean ('isAbstract'            $objReflectionClass->isAbstract ()));
            
$this->___Push (new dataBoolean ('isFinal'                $objReflectionClass->isFinal ()));
            
$this->___Push (new dataString ('FileName'                $objReflectionClass->getFileName ()));
            
$this->___Push (new dataNumber ('StartLine'                $objReflectionClass->getStartLine ()));
            
$this->___Push (new dataNumber ('EndLine'                $objReflectionClass->getEndLine ()));
            
$this->___Push (new dataString ('ExtensionName'            $objReflectionClass->getExtensionName ()));
            
$this->___Push (new dataString ('Modifiers'                implode (' 'Reflection::getModifierNames ($objReflectionClass->getModifiers ()))));
            
$this->___Push (new dataSeries ('Extends''dataPrimitive'));
            
$this->___Push (new dataSeries ('Interfaces''dataPrimitive'));
            
$this->___Push (new dataReflectionDocComment ($objReflectionClass->getDocComment ()));
            
//            $this->___Push (new dataString ('StaticProperties'));
//            $this->___Push (new dataString ('DefaultProperties'));
//            $this->StaticProperties        = $objReflectionClass->getStaticProperties ();
//            $this->DefaultProperties    = $objReflectionClass->getDefaultProperties ();
            
            // Hierarchy of Classes
            
$objFindParent $objReflectionClass;
            
$i 0;
            
            do
            {
                
$objFindParent $objFindParent->getParentClass ();
                
                if (
$objFindParent)
                {
                    
$objParentName = new dataString ('Extend'$objFindParent->getName ());
                    
$objParentName->___setAttribute ('position'$i);
                    
$this->Extends->___Push ($objParentName);
                }
                
                ++
$i;
            } while (
$objFindParent);
            
            
// Interfaces
            
foreach ($objReflectionClass->getInterfaces () as $objInterface)
            {
                
$this->Interfaces->___Push (new dataString ('Interface'$objInterface->getName ()));
            }
            
            
// Syntax Highlighting
            
if ($objReflectionClass->getFileName ())
            {
                
$arrFile file ($this->FileName);
                
$strSyntax '';
                
                foreach (
$arrFile as $i => $strFile)
                {
                    if (
$i+>= (string) $this->StartLine && $i+<= (string) $this->EndLine)
                    {
                        
$strSyntax .= $strFile;
                    }
                }
                
                
$this->___Push (new dataReflectionHighlight ($objReflectionClass->getDocComment (), $strSyntax));
            }
        }
        
        function 
getMethods ()
        {
            
$arrMethod = new dataSeries ('Methods''dataReflectionMethod');
            
            foreach (
$this->_objReflectionClass->getMethods () as $objReflectionMethod)
            {
                
$arrMethod->___Push (new dataReflectionMethod ($objReflectionMethod));
            }
            
            return 
$arrMethod;
        }
        
        function 
getProperties ()
        {
            
$arrProperty = new dataSeries ('Properties''dataReflectionProperty');
            
            foreach (
$this->_objReflectionClass->getProperties () as $objReflectionProperty)
            {
                
$arrProperty->___Push (new dataReflectionProperty ($objReflectionProperty));
            }
            
            return 
$arrProperty;
        }
        
        function 
getConstants ()
        {
            
$arrConstant = new dataSeries ('Constants''dataPrimitive');
            
            foreach (
$this->_objReflectionClass->getConstants () as $strConstantName => $strConstantValue)
            {
                
$objConstant = new dataString ($strConstantName);
                
$objConstant->___setValue ($strConstantValue);
                
                
$arrConstant->___Push ($objConstant);
            }
            
            return 
$arrConstant;
        }
    }

?>