PHP 클래스 Zephir\ClassDefinition

Represents a class/interface and their properties and methods
파일 보기 프로젝트 열기: phalcon/zephir 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$_aliasManager zephir\AliasManager
$abstract boolean
$compiler Compiler
$constants zephir\ClassConstant[]
$dependencyRank integer
$docBlock array
$eventsManager zephir\EventsManager
$extendsClass string
$extendsClassDefinition ClassDefinition
$external boolean
$final boolean
$implementedInterfaceDefinitions ClassDefinition[]
$interfaces array
$isBundled boolean
$isGeneratedConstructor boolean Whether the constructor was generated by zephir (-> no constructor existed previously)
$methods ClassMethod[]
$name string
$namespace string
$originalNode array
$parsedDocblock Zephir\Documentation\Docblock
$properties ClassProperty[]
$shortName string
$type string

공개 메소드들

메소드 설명
__construct ( string $namespace, string $name, string $shortName = null ) ClassDefinition
addConstant ( zephir\ClassConstant $constant ) Adds a constant to the definition
addInitMethod ( zephir\StatementsBlock $statementsBlock ) Creates the initialization method
addMethod ( ClassMethod $method, array $statement = null ) : void Adds a method to the class definition
addProperty ( ClassProperty $property ) Adds a property to the definition
addStaticInitMethod ( zephir\StatementsBlock $statementsBlock ) Creates the static initialization method
buildFromReflection ( ReflectionClass $class ) : ClassDefinition Builds a class definition from reflection
checkInterfaceImplements ( ClassDefinition $classDefinition, ClassDefinition $interfaceDefinition ) Checks if a class implements an interface
compile ( zephir\CompilationContext $compilationContext ) Compiles a class/interface
getAliasManager ( ) : zephir\AliasManager
getCNamespace ( ) : string Returns a valid namespace to be used in C-sources
getClassEntry ( zephir\CompilationContext $compilationContext = null ) : string Returns the name of the zend_class_entry according to the class name
getClassEntryByClassName ( string $className, zephir\CompilationContext $compilationContext, boolean $check = true ) : string Convert Class/Interface name to C ClassEntry
getCompleteName ( ) : string Returns the class name including its namespace
getConstant ( string $constantName ) : boolean | zephir\ClassConstant Returns a constant definition by its name
getConstants ( ) : zephir\ClassConstant[] Returns all constants defined in the class
getDependencies ( ) Calculate the dependency rank of the class based on its dependencies
getDependencyRank ( ) : integer Returns the dependency rank for this class
getDocBlock ( ) : array Returns the class/interface docBlock
getEventsManager ( ) : zephir\EventsManager Get eventsManager for class definition
getExtendsClass ( ) : string Returns the extended class
getExtendsClassDefinition ( ) : ClassDefinition Returns the class definition related to the extended class
getExternalHeader ( ) : string Returns an absolute location to the class header
getImplementedInterfaceDefinitions ( ) : ClassDefinition[] Returns the class definition for the implemented interfaces
getImplementedInterfaces ( ) : array Returns the implemented interfaces
getInitMethod ( ) : ClassMethod Returns the initialization method if any does exist
getLocalOrParentInitMethod ( ) : ClassMethod Returns the initialization method if any does exist
getMethod ( $methodName, boolean | true $checkExtends = true ) : boolean | ClassMethod Returns a method by its name
getMethods ( ) : ClassMethod[] Returns all methods defined in the class
getNCNamespace ( ) : string Returns a valid namespace to be used in C-sources
getName ( ) : string Returns the class name
getNamespace ( ) : string Return the class namespace
getParsedDocBlock ( ) : DocBlock Returns the parsed docBlock
getPossibleMethodName ( string $methodName ) : string | boolean Tries to find the most similar name
getProperties ( ) : ClassProperty[] Returns all properties defined in the class
getProperty ( $propertyName ) : boolean | ClassProperty Returns a method definition by its name
getSCName ( string $namespace ) : string Class name without namespace prefix for class registration
getShortName ( ) : string Returns the class name without namespace
getStaticInitMethod ( ) : ClassMethod Returns the initialization method if any does exist
getType ( ) : string Returns the class type
hasConstant ( string $name ) : boolean Checks if class definition has a property
hasMethod ( $methodName ) : boolean Checks if the class implements an specific name
hasProperty ( string $name ) : boolean Checks if a class definition has a property
increaseDependencyRank ( integer $rank ) A class definition calls this method to mark this class as a dependency of another
isAbstract ( ) : boolean Checks whether the class is abstract or not
isBundled ( ) : boolean Returns whether the class is bundled or not
isExternal ( ) : boolean Returns whether the class is internal or not
isFinal ( ) : boolean Checks whether the class is abstract or not
isGeneratedConstructor ( ) : boolean Returns whether the constructor was generated by zephir
isInterface ( ) : boolean Check if the class definition correspond to an interface
preCompile ( zephir\CompilationContext $compilationContext ) Pre-compiles a class/interface gathering method information required by other methods
setAliasManager ( zephir\AliasManager $aliasManager )
setDocBlock ( array $docBlock ) Sets the class/interface docBlock
setExtendsClass ( string $extendsClass ) Sets the extended class
setExtendsClassDefinition ( $classDefinition ) Sets the class definition for the extended class
setImplementedInterfaceDefinitions ( array $implementedInterfaceDefinitions ) Sets the class definition for the implemented interfaces
setImplementsInterfaces ( array $implementedInterfaces ) Sets the implemented interfaces
setIsAbstract ( boolean $abstract ) Sets if the class is final
setIsBundled ( boolean $isBundled ) Sets if the class is internal or not
setIsExternal ( boolean $isExternal ) Sets whether the class is external or not
setIsFinal ( boolean $final ) Sets if the class is final
setIsGeneratedConstructor ( boolean $isGeneratedConstructor ) Sets if the class constructor was generated by zephir
setMethod ( $methodName, ClassMethod $method ) Set a method and its body
setMethods ( array $methods ) Sets class methods externally
setOriginalNode ( array $originalNode ) Set the original node where the class was declared
setType ( string $type ) Set the class' type (class/interface)
updateMethod ( ClassMethod $method, array $statement = null ) : void Updates an existing method definition

보호된 메소드들

메소드 설명
getConstantFromInterfaces ( $name ) : boolean | zephir\ClassConstant
hasConstantFromInterfaces ( $name ) : boolean

비공개 메소드들

메소드 설명
_convertPhpConstantType ( $phpType )

메소드 상세

__construct() 공개 메소드

ClassDefinition
public __construct ( string $namespace, string $name, string $shortName = null )
$namespace string
$name string
$shortName string

addConstant() 공개 메소드

Adds a constant to the definition
public addConstant ( zephir\ClassConstant $constant )
$constant zephir\ClassConstant

addInitMethod() 공개 메소드

Creates the initialization method
public addInitMethod ( zephir\StatementsBlock $statementsBlock )
$statementsBlock zephir\StatementsBlock

addMethod() 공개 메소드

Adds a method to the class definition
public addMethod ( ClassMethod $method, array $statement = null ) : void
$method ClassMethod
$statement array
리턴 void

addProperty() 공개 메소드

Adds a property to the definition
public addProperty ( ClassProperty $property )
$property ClassProperty

addStaticInitMethod() 공개 메소드

Creates the static initialization method
public addStaticInitMethod ( zephir\StatementsBlock $statementsBlock )
$statementsBlock zephir\StatementsBlock

buildFromReflection() 공개 정적인 메소드

Builds a class definition from reflection
public static buildFromReflection ( ReflectionClass $class ) : ClassDefinition
$class ReflectionClass
리턴 ClassDefinition

checkInterfaceImplements() 공개 메소드

Checks if a class implements an interface
public checkInterfaceImplements ( ClassDefinition $classDefinition, ClassDefinition $interfaceDefinition )
$classDefinition ClassDefinition
$interfaceDefinition ClassDefinition

compile() 공개 메소드

Compiles a class/interface
public compile ( zephir\CompilationContext $compilationContext )
$compilationContext zephir\CompilationContext

getAliasManager() 공개 메소드

public getAliasManager ( ) : zephir\AliasManager
리턴 zephir\AliasManager

getCNamespace() 공개 메소드

Returns a valid namespace to be used in C-sources
public getCNamespace ( ) : string
리턴 string

getClassEntry() 공개 메소드

Returns the name of the zend_class_entry according to the class name
public getClassEntry ( zephir\CompilationContext $compilationContext = null ) : string
$compilationContext zephir\CompilationContext
리턴 string

getClassEntryByClassName() 공개 메소드

Convert Class/Interface name to C ClassEntry
public getClassEntryByClassName ( string $className, zephir\CompilationContext $compilationContext, boolean $check = true ) : string
$className string
$compilationContext zephir\CompilationContext
$check boolean
리턴 string

getCompleteName() 공개 메소드

Returns the class name including its namespace
public getCompleteName ( ) : string
리턴 string

getConstant() 공개 메소드

Returns a constant definition by its name
public getConstant ( string $constantName ) : boolean | zephir\ClassConstant
$constantName string
리턴 boolean | zephir\ClassConstant

getConstantFromInterfaces() 보호된 메소드

protected getConstantFromInterfaces ( $name ) : boolean | zephir\ClassConstant
$name
리턴 boolean | zephir\ClassConstant

getConstants() 공개 메소드

Returns all constants defined in the class
public getConstants ( ) : zephir\ClassConstant[]
리턴 zephir\ClassConstant[]

getDependencies() 공개 메소드

Calculate the dependency rank of the class based on its dependencies
public getDependencies ( )

getDependencyRank() 공개 메소드

Returns the dependency rank for this class
public getDependencyRank ( ) : integer
리턴 integer

getDocBlock() 공개 메소드

Returns the class/interface docBlock
public getDocBlock ( ) : array
리턴 array

getEventsManager() 공개 메소드

Get eventsManager for class definition
public getEventsManager ( ) : zephir\EventsManager
리턴 zephir\EventsManager

getExtendsClass() 공개 메소드

Returns the extended class
public getExtendsClass ( ) : string
리턴 string

getExtendsClassDefinition() 공개 메소드

Returns the class definition related to the extended class
public getExtendsClassDefinition ( ) : ClassDefinition
리턴 ClassDefinition

getExternalHeader() 공개 메소드

Returns an absolute location to the class header
public getExternalHeader ( ) : string
리턴 string

getImplementedInterfaceDefinitions() 공개 메소드

Returns the class definition for the implemented interfaces
public getImplementedInterfaceDefinitions ( ) : ClassDefinition[]
리턴 ClassDefinition[]

getImplementedInterfaces() 공개 메소드

Returns the implemented interfaces
public getImplementedInterfaces ( ) : array
리턴 array

getInitMethod() 공개 메소드

Returns the initialization method if any does exist
public getInitMethod ( ) : ClassMethod
리턴 ClassMethod

getLocalOrParentInitMethod() 공개 메소드

Returns the initialization method if any does exist
public getLocalOrParentInitMethod ( ) : ClassMethod
리턴 ClassMethod

getMethod() 공개 메소드

Returns a method by its name
public getMethod ( $methodName, boolean | true $checkExtends = true ) : boolean | ClassMethod
$checkExtends boolean | true
리턴 boolean | ClassMethod

getMethods() 공개 메소드

Returns all methods defined in the class
public getMethods ( ) : ClassMethod[]
리턴 ClassMethod[]

getNCNamespace() 공개 메소드

Returns a valid namespace to be used in C-sources
public getNCNamespace ( ) : string
리턴 string

getName() 공개 메소드

Returns the class name
public getName ( ) : string
리턴 string

getNamespace() 공개 메소드

Return the class namespace
public getNamespace ( ) : string
리턴 string

getParsedDocBlock() 공개 메소드

Returns the parsed docBlock
public getParsedDocBlock ( ) : DocBlock
리턴 DocBlock

getPossibleMethodName() 공개 메소드

Tries to find the most similar name
public getPossibleMethodName ( string $methodName ) : string | boolean
$methodName string
리턴 string | boolean

getProperties() 공개 메소드

Returns all properties defined in the class
public getProperties ( ) : ClassProperty[]
리턴 ClassProperty[]

getProperty() 공개 메소드

Returns a method definition by its name
public getProperty ( $propertyName ) : boolean | ClassProperty
리턴 boolean | ClassProperty

getSCName() 공개 메소드

Class name without namespace prefix for class registration
public getSCName ( string $namespace ) : string
$namespace string
리턴 string

getShortName() 공개 메소드

Returns the class name without namespace
public getShortName ( ) : string
리턴 string

getStaticInitMethod() 공개 메소드

Returns the initialization method if any does exist
public getStaticInitMethod ( ) : ClassMethod
리턴 ClassMethod

getType() 공개 메소드

Returns the class type
public getType ( ) : string
리턴 string

hasConstant() 공개 메소드

Checks if class definition has a property
public hasConstant ( string $name ) : boolean
$name string
리턴 boolean

hasConstantFromInterfaces() 보호된 메소드

protected hasConstantFromInterfaces ( $name ) : boolean
$name
리턴 boolean

hasMethod() 공개 메소드

Checks if the class implements an specific name
public hasMethod ( $methodName ) : boolean
리턴 boolean

hasProperty() 공개 메소드

Checks if a class definition has a property
public hasProperty ( string $name ) : boolean
$name string
리턴 boolean

increaseDependencyRank() 공개 메소드

A class definition calls this method to mark this class as a dependency of another
public increaseDependencyRank ( integer $rank )
$rank integer

isAbstract() 공개 메소드

Checks whether the class is abstract or not
public isAbstract ( ) : boolean
리턴 boolean

isBundled() 공개 메소드

Returns whether the class is bundled or not
public isBundled ( ) : boolean
리턴 boolean

isExternal() 공개 메소드

Returns whether the class is internal or not
public isExternal ( ) : boolean
리턴 boolean

isFinal() 공개 메소드

Checks whether the class is abstract or not
public isFinal ( ) : boolean
리턴 boolean

isGeneratedConstructor() 공개 메소드

Returns whether the constructor was generated by zephir
public isGeneratedConstructor ( ) : boolean
리턴 boolean

isInterface() 공개 메소드

Check if the class definition correspond to an interface
public isInterface ( ) : boolean
리턴 boolean

preCompile() 공개 메소드

Pre-compiles a class/interface gathering method information required by other methods
public preCompile ( zephir\CompilationContext $compilationContext )
$compilationContext zephir\CompilationContext

setAliasManager() 공개 메소드

public setAliasManager ( zephir\AliasManager $aliasManager )
$aliasManager zephir\AliasManager

setDocBlock() 공개 메소드

Sets the class/interface docBlock
public setDocBlock ( array $docBlock )
$docBlock array

setExtendsClass() 공개 메소드

Sets the extended class
public setExtendsClass ( string $extendsClass )
$extendsClass string

setExtendsClassDefinition() 공개 메소드

Sets the class definition for the extended class
public setExtendsClassDefinition ( $classDefinition )
$classDefinition

setImplementedInterfaceDefinitions() 공개 메소드

Sets the class definition for the implemented interfaces
public setImplementedInterfaceDefinitions ( array $implementedInterfaceDefinitions )
$implementedInterfaceDefinitions array

setImplementsInterfaces() 공개 메소드

Sets the implemented interfaces
public setImplementsInterfaces ( array $implementedInterfaces )
$implementedInterfaces array

setIsAbstract() 공개 메소드

Sets if the class is final
public setIsAbstract ( boolean $abstract )
$abstract boolean

setIsBundled() 공개 메소드

Sets if the class is internal or not
public setIsBundled ( boolean $isBundled )
$isBundled boolean

setIsExternal() 공개 메소드

Sets whether the class is external or not
public setIsExternal ( boolean $isExternal )
$isExternal boolean

setIsFinal() 공개 메소드

Sets if the class is final
public setIsFinal ( boolean $final )
$final boolean

setIsGeneratedConstructor() 공개 메소드

Sets if the class constructor was generated by zephir
public setIsGeneratedConstructor ( boolean $isGeneratedConstructor )
$isGeneratedConstructor boolean

setMethod() 공개 메소드

Set a method and its body
public setMethod ( $methodName, ClassMethod $method )
$methodName
$method ClassMethod

setMethods() 공개 메소드

Sets class methods externally
public setMethods ( array $methods )
$methods array

setOriginalNode() 공개 메소드

Set the original node where the class was declared
public setOriginalNode ( array $originalNode )
$originalNode array

setType() 공개 메소드

Set the class' type (class/interface)
public setType ( string $type )
$type string

updateMethod() 공개 메소드

Updates an existing method definition
public updateMethod ( ClassMethod $method, array $statement = null ) : void
$method ClassMethod
$statement array
리턴 void

프로퍼티 상세

$_aliasManager 보호되어 있는 프로퍼티

protected AliasManager,zephir $_aliasManager
리턴 zephir\AliasManager

$abstract 보호되어 있는 프로퍼티

protected bool $abstract
리턴 boolean

$compiler 보호되어 있는 프로퍼티

protected Compiler,zephir $compiler
리턴 Compiler

$constants 보호되어 있는 프로퍼티

protected ClassConstant[],zephir $constants
리턴 zephir\ClassConstant[]

$dependencyRank 보호되어 있는 프로퍼티

protected int $dependencyRank
리턴 integer

$docBlock 보호되어 있는 프로퍼티

protected array $docBlock
리턴 array

$eventsManager 보호되어 있는 프로퍼티

protected EventsManager,zephir $eventsManager
리턴 zephir\EventsManager

$extendsClass 보호되어 있는 프로퍼티

protected string $extendsClass
리턴 string

$extendsClassDefinition 보호되어 있는 프로퍼티

protected ClassDefinition,zephir $extendsClassDefinition
리턴 ClassDefinition

$external 보호되어 있는 프로퍼티

protected bool $external
리턴 boolean

$final 보호되어 있는 프로퍼티

protected bool $final
리턴 boolean

$implementedInterfaceDefinitions 보호되어 있는 프로퍼티

protected ClassDefinition[],zephir $implementedInterfaceDefinitions
리턴 ClassDefinition[]

$interfaces 보호되어 있는 프로퍼티

protected array $interfaces
리턴 array

$isBundled 보호되어 있는 프로퍼티

protected bool $isBundled
리턴 boolean

$isGeneratedConstructor 보호되어 있는 프로퍼티

Whether the constructor was generated by zephir (-> no constructor existed previously)
protected bool $isGeneratedConstructor
리턴 boolean

$methods 보호되어 있는 프로퍼티

protected ClassMethod[],zephir $methods
리턴 ClassMethod[]

$name 보호되어 있는 프로퍼티

protected string $name
리턴 string

$namespace 보호되어 있는 프로퍼티

protected string $namespace
리턴 string

$originalNode 보호되어 있는 프로퍼티

protected array $originalNode
리턴 array

$parsedDocblock 보호되어 있는 프로퍼티

protected Docblock,Zephir\Documentation $parsedDocblock
리턴 Zephir\Documentation\Docblock

$properties 보호되어 있는 프로퍼티

protected ClassProperty[],zephir $properties
리턴 ClassProperty[]

$shortName 보호되어 있는 프로퍼티

protected string $shortName
리턴 string

$type 보호되어 있는 프로퍼티

protected string $type
리턴 string