您的位置:首页 > 编程语言 > PHP开发

PHP反射的一些特性

2010-11-23 21:25 405 查看
publicfunctiongetByObjectId($id){ $id=(int)$id; if($id){ $SQL="select*from{$this->__DTN}whereid=$id"; $refl=newReflectionClass(get_class($this)); return$refl->newInstance(); }else{ returnfalse; } }手册中:

Classes/Object函数

TableofContents

call_user_method_array—调用一个用户方法,同时传递参数数组(已废弃)
call_user_method—对特定对象调用用户方法(已废弃)
class_alias—Createsanaliasforaclass
class_exists—检查类是否已定义
get_called_class—the"LateStaticBinding"classname
get_class_methods—返回由类的方法名组成的数组
get_class_vars—返回由类的默认属性组成的数组
get_class—返回对象的类名
get_declared_classes—返回由已定义类的名字所组成的数组
get_declared_interfaces—返回一个数组包含所有已声明的接口
get_object_vars—返回由对象属性组成的关联数组
get_parent_class—返回对象或类的父类名
interface_exists—检查接口是否已被定义
is_a—如果对象属于该类或该类是此对象的父类则返回TRUE
is_subclass_of—如果此对象是该类的子类,则返回TRUE
method_exists—检查类的方法是否存在
property_exists—检查对象或类是否具有该属性

Reflection—TheReflectionclass

Reflection::export—Exports
Reflection::getModifierNames—Getsmodifiernames

ReflectionClass—TheReflectionClassclass

ReflectionClass::__clone—Clonesobject
ReflectionClass::__construct—ConstructsaReflectionClass
ReflectionClass::export—Exportsaclass
ReflectionClass::getConstant—Getsdefinedconstants
ReflectionClass::getConstants—Getsconstants
ReflectionClass::getConstructor—Getsconstructor
ReflectionClass::getDefaultProperties—Getsdefaultproperties
ReflectionClass::getDocComment—Getsdoccomments
ReflectionClass::getEndLine—Getsendline
ReflectionClass::getExtension—Getsextensioninfo
ReflectionClass::getExtensionName—Getsanextensionsname
ReflectionClass::getFileName—Getsthefilenameofthefileinwhichtheclasshasbeendefined
ReflectionClass::getInterfaceNames—Getstheinterfacenames
ReflectionClass::getInterfaces—Getstheinterfaces
ReflectionClass::getMethod—GetsaReflectionMethod
ReflectionClass::getMethods—Getsalistofmethods
ReflectionClass::getModifiers—Getsmodifiers
ReflectionClass::getName—Getsclassname
ReflectionClass::getNamespaceName—Getsnamespacename
ReflectionClass::getParentClass—Getsparentclass
ReflectionClass::getProperties—Getsproperties
ReflectionClass::getProperty—Getsproperty
ReflectionClass::getShortName—Getsshortname
ReflectionClass::getStartLine—Getsstartinglinenumber
ReflectionClass::getStaticProperties—Getsstaticproperties
ReflectionClass::getStaticPropertyValue—Getsstaticpropertyvalue
ReflectionClass::hasConstant—Checksifconstantisdefined
ReflectionClass::hasMethod—Checksifmethodisdefined
ReflectionClass::hasProperty—Checksifpropertyisdefined
ReflectionClass::implementsInterface—Implementsinterface
ReflectionClass::inNamespace—Checksifinnamespace
ReflectionClass::isAbstract—Checksifclassisabstract
ReflectionClass::isFinal—Checksifclassisfinal
ReflectionClass::isInstance—Checksclassforinstance
ReflectionClass::isInstantiable—Checksifinstantiable
ReflectionClass::isInterface—Checksifinterface
ReflectionClass::isInternal—Checksifinternal
ReflectionClass::isIterateable—Checksifiterateable
ReflectionClass::isSubclassOf—Checksifasubclass
ReflectionClass::isUserDefined—Checksifuserdefined
ReflectionClass::newInstance—Createsanewcassinstancefromgivenarguments.
ReflectionClass::newInstanceArgs—Createsanewcassinstancefromgivenarguments.
ReflectionClass::setStaticPropertyValue—Setsstaticpropertyvalue
ReflectionClass::__toString—ReturnsthestringrepresentationoftheReflectionClassobject.

ReflectionExtension—TheReflectionExtensionclass

ReflectionExtension::__clone—Clones
ReflectionExtension::__construct—ConstructsaReflectionExtension
ReflectionExtension::export—Export
ReflectionExtension::getClasses—Getsclasses
ReflectionExtension::getClassNames—Getsclassnames
ReflectionExtension::getConstants—Getsconstants
ReflectionExtension::getDependencies—Getsdependencies
ReflectionExtension::getFunctions—Getsextensionfunctions
ReflectionExtension::getINIEntries—Getsextensioninientries
ReflectionExtension::getName—Getsextensionname
ReflectionExtension::getVersion—Getsextensionversion
ReflectionExtension::info—Getsextensioninfo
ReflectionExtension::__toString—Tostring

ReflectionFunction—TheReflectionFunctionclass

ReflectionFunction::__construct—ConstructsaReflectionFunctionobject
ReflectionFunction::export—Exportsfunction
ReflectionFunction::invoke—Invokesfunction
ReflectionFunction::invokeArgs—Invokesfunctionargs
ReflectionFunction::isDisabled—Checksiffunctionisdisabled
ReflectionFunction::__toString—Tostring

ReflectionFunctionAbstract—TheReflectionFunctionAbstractclass

ReflectionFunctionAbstract::__clone—Clonesfunction
ReflectionFunctionAbstract::getDocComment—Getsdoccomment
ReflectionFunctionAbstract::getEndLine—Getsendlinenumber
ReflectionFunctionAbstract::getExtension—Getsextensioninfo
ReflectionFunctionAbstract::getExtensionName—Getsextensionname
ReflectionFunctionAbstract::getFileName—Getsfilename
ReflectionFunctionAbstract::getName—Getsfunctionname
ReflectionFunctionAbstract::getNamespaceName—Getsnamespacename
ReflectionFunctionAbstract::getNumberOfParameters—Getsnumberofparameters
ReflectionFunctionAbstract::getNumberOfRequiredParameters—Getsnumberofrequiredparameters
ReflectionFunctionAbstract::getParameters—Getsparameters
ReflectionFunctionAbstract::getShortName—Getsfunctionshortname
ReflectionFunctionAbstract::getStartLine—Getsstartinglinenumber
ReflectionFunctionAbstract::getStaticVariables—Getsstaticvariables
ReflectionFunctionAbstract::inNamespace—Checksiffunctioninnamespace
ReflectionFunctionAbstract::isClosure—Checksifclosure
ReflectionFunctionAbstract::isDeprecated—Checksifdeprecated
ReflectionFunctionAbstract::isInternal—Checksifisinternal
ReflectionFunctionAbstract::isUserDefined—Checksifuserdefined
ReflectionFunctionAbstract::returnsReference—Checksifreturnsreference
ReflectionFunctionAbstract::__toString—Tostring

ReflectionMethod—TheReflectionMethodclass

ReflectionMethod::__construct—ConstructsaReflectionMethod
ReflectionMethod::export—Exportareflectionmethod.
ReflectionMethod::getDeclaringClass—Getsdeclaringclassforthereflectedmethod.
ReflectionMethod::getModifiers—Getsthemethodmodifiers
ReflectionMethod::getPrototype—Getsthemethodprototype(ifthereisone).
ReflectionMethod::invoke—Invoke
ReflectionMethod::invokeArgs—Invokeargs
ReflectionMethod::isAbstract—Checksifmethodisabstract
ReflectionMethod::isConstructor—Checksifmethodisaconstructor
ReflectionMethod::isDestructor—Checksifmethodisadestructor
ReflectionMethod::isFinal—Checksifmethodisfinal
ReflectionMethod::isPrivate—Checksifmethodisprivate
ReflectionMethod::isProtected—Checksifmethodisprotected
ReflectionMethod::isPublic—Checksifmethodispublic
ReflectionMethod::isStatic—Checksifmethodisstatic
ReflectionMethod::setAccessible—Setmethodaccessibility
ReflectionMethod::__toString—ReturnsthestringrepresentationoftheReflectionmethodobject.

ReflectionObject—TheReflectionObjectclass

ReflectionObject::__construct—ConstructsaReflectionObject
ReflectionObject::export—Export

ReflectionParameter—TheReflectionParameterclass

ReflectionParameter::allowsNull—Checksifnullisallowed
ReflectionParameter::__clone—Clone
ReflectionParameter::__construct—Construct
ReflectionParameter::export—Exports
ReflectionParameter::getClass—Getclass
ReflectionParameter::getDeclaringClass—Getsdeclaringclass
ReflectionParameter::getDeclaringFunction—Getsdeclaringfunction
ReflectionParameter::getDefaultValue—Getsdefaultparametervalue
ReflectionParameter::getName—Getsparametername
ReflectionParameter::getPosition—Getsparameterposition
ReflectionParameter::isArray—Checksifparameterexpectsanarray
ReflectionParameter::isDefaultValueAvailable—Checksifadefaultvalueisavailable
ReflectionParameter::isOptional—Checksifoptional
ReflectionParameter::isPassedByReference—Checksifpassedbyreference
ReflectionParameter::__toString—Tostring

ReflectionProperty—TheReflectionPropertyclass

ReflectionProperty::__clone—Clone
ReflectionProperty::__construct—ConstructaReflectionPropertyobject
ReflectionProperty::export—Export
ReflectionProperty::getDeclaringClass—Getsdeclaringclass
ReflectionProperty::getDocComment—Getsdoccomment
ReflectionProperty::getModifiers—Getsmodifiers
ReflectionProperty::getName—Getspropertyname
ReflectionProperty::getValue—Getsvalue
ReflectionProperty::isDefault—Checksifdefaultvalue
ReflectionProperty::isPrivate—Checksifpropertyisprivate
ReflectionProperty::isProtected—Checksifpropertyisprotected
ReflectionProperty::isPublic—Checksifpropertyispublic
ReflectionProperty::isStatic—Checksifpropertyisstatic
ReflectionProperty::setAccessible—Setpropertyaccessibility
ReflectionProperty::setValue—Setpropertyvalue
ReflectionProperty::__toString—Tostring

Reflector—TheReflectorinterface

Reflector::export—Exports
Reflector::__toString—Tostring

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: