2009-07-07 00:34:54 +04:00
|
|
|
<?php
|
2009-08-06 01:13:42 +04:00
|
|
|
/*
|
|
|
|
* $Id$
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
|
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
|
|
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
|
|
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
|
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
|
|
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
|
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
|
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
|
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*
|
|
|
|
* This software consists of voluntary contributions made by many individuals
|
|
|
|
* and is licensed under the LGPL. For more information, see
|
|
|
|
* <http://www.doctrine-project.org>.
|
|
|
|
*/
|
2009-07-07 00:34:54 +04:00
|
|
|
|
|
|
|
namespace Doctrine\Common\Annotations;
|
|
|
|
|
2009-08-06 01:13:42 +04:00
|
|
|
/**
|
|
|
|
* Annotations class
|
|
|
|
*
|
|
|
|
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
|
|
|
|
* @link www.doctrine-project.org
|
|
|
|
* @since 2.0
|
2010-04-23 07:51:32 +04:00
|
|
|
* @version $Revision$
|
|
|
|
* @author Benjamin Eberlei <kontakt@beberlei.de>
|
2009-08-06 01:13:42 +04:00
|
|
|
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
|
|
|
|
* @author Jonathan Wage <jonwage@gmail.com>
|
|
|
|
* @author Roman Borschel <roman@code-factory.org>
|
|
|
|
*/
|
2009-07-07 00:34:54 +04:00
|
|
|
class Annotation
|
|
|
|
{
|
2009-08-06 01:13:42 +04:00
|
|
|
/**
|
|
|
|
* Value property. Common among all derived classes.
|
|
|
|
*
|
|
|
|
* @var string
|
|
|
|
*/
|
2009-07-07 00:34:54 +04:00
|
|
|
public $value;
|
|
|
|
|
2009-08-06 01:13:42 +04:00
|
|
|
/**
|
|
|
|
* Constructor
|
|
|
|
*
|
|
|
|
* @param array $data Key-value for properties to be defined in this class
|
|
|
|
*/
|
2009-07-07 00:34:54 +04:00
|
|
|
public final function __construct(array $data)
|
|
|
|
{
|
|
|
|
foreach ($data as $key => $value) {
|
|
|
|
$this->$key = $value;
|
|
|
|
}
|
|
|
|
}
|
2010-04-23 07:51:32 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Error handler for unknown property accessor in Annotation class.
|
|
|
|
*
|
|
|
|
* @param string $name Unknown property name
|
|
|
|
*/
|
2010-02-09 20:13:49 +03:00
|
|
|
public function __get($name)
|
|
|
|
{
|
2010-04-23 07:51:32 +04:00
|
|
|
throw new \BadMethodCallException(
|
|
|
|
sprintf("Unknown property '%s' on annotation '%s'.", $name, get_class($this))
|
|
|
|
);
|
2010-02-09 20:13:49 +03:00
|
|
|
}
|
|
|
|
|
2010-04-23 07:51:32 +04:00
|
|
|
/**
|
|
|
|
* Error handler for unknown property mutator in Annotation class.
|
|
|
|
*
|
|
|
|
* @param string $name Unkown property name
|
|
|
|
* @param mixed $value Property value
|
|
|
|
*/
|
2010-02-09 20:13:49 +03:00
|
|
|
public function __set($name, $value)
|
|
|
|
{
|
2010-04-23 07:51:32 +04:00
|
|
|
throw new \BadMethodCallException(
|
|
|
|
sprintf("Unknown property '%s' on annotation '%s'.", $name, get_class($this))
|
|
|
|
);
|
2010-02-09 20:13:49 +03:00
|
|
|
}
|
2009-07-07 00:34:54 +04:00
|
|
|
}
|