Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

148 lines (97 sloc) 2.294 kB
<?php
/**
* This file is part of the Nette Framework (http://nette.org)
*
* Copyright (c) 2004, 2011 David Grudl (http://davidgrudl.com)
*
* For the full copyright and license information, please view
* the file license.txt that was distributed with this source code.
*/
namespace Nette\Reflection;
use Nette,
Nette\ObjectMixin;
/**
* Reports information about a classes variable.
*
* @author David Grudl
*/
class Property extends \ReflectionProperty
{
public function __toString()
{
return 'Property ' . parent::getDeclaringClass()->getName() . '::$' . $this->getName();
}
/********************* Reflection layer ****************d*g**/
/**
* @return ClassType
*/
public function getDeclaringClass()
{
return new ClassType(parent::getDeclaringClass()->getName());
}
/********************* Nette\Annotations support ****************d*g**/
/**
* Has property specified annotation?
* @param string
* @return bool
*/
public function hasAnnotation($name)
{
$res = AnnotationsParser::getAll($this);
return !empty($res[$name]);
}
/**
* Returns an annotation value.
* @param string
* @return IAnnotation
*/
public function getAnnotation($name)
{
$res = AnnotationsParser::getAll($this);
return isset($res[$name]) ? end($res[$name]) : NULL;
}
/**
* Returns all annotations.
* @return array
*/
public function getAnnotations()
{
return AnnotationsParser::getAll($this);
}
/**
* Returns value of annotation 'description'.
* @return string
*/
public function getDescription()
{
return $this->getAnnotation('description');
}
/********************* Nette\Object behaviour ****************d*g**/
/**
* @return ClassType
*/
public /**/static/**/ function getReflection()
{
return new ClassType(/*5.2*$this*//**/get_called_class()/**/);
}
public function __call($name, $args)
{
return ObjectMixin::call($this, $name, $args);
}
public function &__get($name)
{
return ObjectMixin::get($this, $name);
}
public function __set($name, $value)
{
return ObjectMixin::set($this, $name, $value);
}
public function __isset($name)
{
return ObjectMixin::has($this, $name);
}
public function __unset($name)
{
ObjectMixin::remove($this, $name);
}
}
Jump to Line
Something went wrong with that request. Please try again.