Skip to content


DCOM-94: Support for constants on annotation reader #696

doctrinebot opened this Issue · 4 comments

1 participant


Jira issue originally created by user @FabioBatSilva:

Would be nice get support for constants on annotation reader.

Usage :

* @SomeAnnotation(PHP_EOL)
* @SomeAnnotation(SomeClass::SOME_VALUE)
* @SomeAnnotation({SomeClass::VALUE1,SomeClass::VALUE2})
* @SomeAnnotation({SomeClass::SOME*KEY = SomeClass::SOME*VALUE})

Comment created by gabrielnn77:

file doctrine-2.2.0/Doctrine/Common/Lexer.php
line 214
@patch : para poder usar constantes
* definidas con define como param de las anotaciones
* las constantes deben empesar por '_' para evitar conflictos con 'false' y 'true'
* esto solo soporta constantes en los valores de las anotaciones
* ej:

                define('*db_clase_05', '"test.Clase*05"');
                /**** @Table(name=*db_clase*05) 
                ... */
                class Clase_05{

        if(is*string($match[0]) && ($match[0][0] == '*') && defined($match[0])){
            $aux_val = constant($match[0]);
            $match[0] = $aux_val;

Comment created by @FabioBatSilva:

hello gabriel,

I have a pull request opened : #104

feel free to join us and comment ...
in inglesh please :)


Comment created by @FabioBatSilva:

Fixed : 970912e


Issue was closed with resolution "Fixed"

@doctrinebot doctrinebot added this to the 2.3 milestone
@doctrinebot doctrinebot closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.