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
  • PHP

Classes

  • NAnnotation
  • NAnnotationsParser
  • NClassReflection
  • NExtensionReflection
  • NFunctionReflection
  • NMethodReflection
  • NParameterReflection
  • NPropertyReflection

Interfaces

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