La classe ReflectionProperty

(PHP 5, PHP 7)

Introduction

La classe ReflectionProperty rapporte des informations sur les propriétés des classes.

Synopsis de la classe

ReflectionProperty implements Reflector {
/* Constantes */
const int IS_STATIC = 1 ;
const int IS_PUBLIC = 256 ;
const int IS_PROTECTED = 512 ;
const int IS_PRIVATE = 1024 ;
/* Propriétés */
public $name ;
public $class ;
/* Méthodes */
public __construct ( object|string $class , string $property )
final private __clone ( ) : void
public static export ( mixed $class , string $name , bool $return = ? ) : string
public getDefaultValue ( ) : mixed
public getDocComment ( ) : string|false
public getModifiers ( ) : int
public getName ( ) : string
public getType ( ) : ReflectionType|null
public getValue ( object|null $object = null ) : mixed
public hasDefaultValue ( ) : bool
public hasType ( ) : bool
public isDefault ( ) : bool
public isInitialized ( object|null $object = null ) : bool
public isPrivate ( ) : bool
public isProtected ( ) : bool
public isPublic ( ) : bool
public isStatic ( ) : bool
public setAccessible ( bool $accessible ) : void
public setValue ( object $object , mixed $value ) : void
public __toString ( ) : string
}

Propriétés

name

Nom de la propriété. En lecture seule, émets ReflectionException lors d'une tentative d'écriture.

class

Nom de la classe où la propriété a été définie. En lecture seule, émets ReflectionException lors d'une tentative d'écriture.

Constantes pré-définies

Modificateurs de ReflectionProperty

ReflectionProperty::IS_STATIC

Indique que la propriété est statique.

ReflectionProperty::IS_PUBLIC

Indique que la propriété est publique.

ReflectionProperty::IS_PROTECTED

Indique que la propriété est protégée.

ReflectionProperty::IS_PRIVATE

Indique que la propriété est privée.

Sommaire