Packages

  • Nette
    • Application
      • Diagnostics
      • Responses
      • Routers
      • UI
    • Caching
      • Storages
    • ComponentModel
    • Config
      • Adapters
      • Extensions
    • Database
      • Diagnostics
      • Drivers
      • Reflection
      • Table
    • DI
      • Diagnostics
    • Diagnostics
    • Forms
      • Controls
      • Rendering
    • Http
    • Iterators
    • Latte
      • Macros
    • Loaders
    • Localization
    • Mail
    • Reflection
    • Security
      • Diagnostics
    • Templating
    • Utils
      • PhpGenerator
  • NetteModule
  • none

Classes

Interfaces

  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Other releases
  • Nette homepage
  1: <?php
  2: 
  3: /**
  4:  * This file is part of the Nette Framework (https://nette.org)
  5:  * Copyright (c) 2004 David Grudl (http://davidgrudl.com)
  6:  * @package Nette\Reflection
  7:  */
  8: 
  9: 
 10: 
 11: /**
 12:  * Reports information about a classes variable.
 13:  *
 14:  * @author     David Grudl
 15:  * @property-read ClassReflection $declaringClass
 16:  * @property-read IAnnotation[][] $annotations
 17:  * @property-read string $description
 18:  * @property-read string $name
 19:  * @property  mixed $value
 20:  * @property-read bool $public
 21:  * @property-read bool $private
 22:  * @property-read bool $protected
 23:  * @property-read bool $static
 24:  * @property-read bool $default
 25:  * @property-read int $modifiers
 26:  * @property-read string $docComment
 27:  * @property-write bool $accessible
 28:  * @package Nette\Reflection
 29:  */
 30: class PropertyReflection extends ReflectionProperty
 31: {
 32: 
 33:     public function __toString()
 34:     {
 35:         return 'Property ' . parent::getDeclaringClass()->getName() . '::$' . $this->getName();
 36:     }
 37: 
 38: 
 39:     /********************* Reflection layer ****************d*g**/
 40: 
 41: 
 42:     /**
 43:      * @return ClassReflection
 44:      */
 45:     public function getDeclaringClass()
 46:     {
 47:         return new ClassReflection(parent::getDeclaringClass()->getName());
 48:     }
 49: 
 50: 
 51:     /********************* Annotations support ****************d*g**/
 52: 
 53: 
 54:     /**
 55:      * Has property specified annotation?
 56:      * @param  string
 57:      * @return bool
 58:      */
 59:     public function hasAnnotation($name)
 60:     {
 61:         $res = AnnotationsParser::getAll($this);
 62:         return !empty($res[$name]);
 63:     }
 64: 
 65: 
 66:     /**
 67:      * Returns an annotation value.
 68:      * @param  string
 69:      * @return IAnnotation
 70:      */
 71:     public function getAnnotation($name)
 72:     {
 73:         $res = AnnotationsParser::getAll($this);
 74:         return isset($res[$name]) ? end($res[$name]) : NULL;
 75:     }
 76: 
 77: 
 78:     /**
 79:      * Returns all annotations.
 80:      * @return IAnnotation[][]
 81:      */
 82:     public function getAnnotations()
 83:     {
 84:         return AnnotationsParser::getAll($this);
 85:     }
 86: 
 87: 
 88:     /**
 89:      * Returns value of annotation 'description'.
 90:      * @return string
 91:      */
 92:     public function getDescription()
 93:     {
 94:         return $this->getAnnotation('description');
 95:     }
 96: 
 97: 
 98:     /********************* Object behaviour ****************d*g**/
 99: 
100: 
101:     /**
102:      * @return ClassReflection
103:      */
104:     public function getReflection()
105:     {
106:         return new ClassReflection($this);
107:     }
108: 
109: 
110:     public function __call($name, $args)
111:     {
112:         return ObjectMixin::call($this, $name, $args);
113:     }
114: 
115: 
116:     public function &__get($name)
117:     {
118:         return ObjectMixin::get($this, $name);
119:     }
120: 
121: 
122:     public function __set($name, $value)
123:     {
124:         ObjectMixin::set($this, $name, $value);
125:     }
126: 
127: 
128:     public function __isset($name)
129:     {
130:         return ObjectMixin::has($this, $name);
131:     }
132: 
133: 
134:     public function __unset($name)
135:     {
136:         ObjectMixin::remove($this, $name);
137:     }
138: 
139: }
140: 
Nette Framework 2.0.18 (for PHP 5.2, un-prefixed) API documentation generated by ApiGen 2.8.0