[DDC-1645] Paths to Annotations classes are not considered Created: 10/Feb/12 Updated: 10/Feb/12
|Project:||Doctrine 2 - ORM|
|Component/s:||Documentation, Mapping Drivers|
|Reporter:||feathers and down||Assignee:||Benjamin Eberlei|
openSUSE 12.1 x86, Apache/2.2.21, mysql 5.5.16, PHP 5.3.8 (modules: Core, ctype, curl, date, dom, ereg, filter, gd, hash, http, iconv, json, libxml, mbstring, mcrypt, mhash, mysql, mysqli, mysqlnd, pcre, PDO, pdo_mysql, pdo_sqlite, Reflection, session, SimpleXML, SPL, SQLite, sqlite3, standard, tokenizer, xml, xmlreader, xmlwriter, zip, zlib )
Hi, my battle is described here: http://groups.google.com/group/doctrine-user/browse_thread/thread/db9c77b6bc000f13
When I follow bugtracker tutorial I think that there is an error when working with Annotations, see these examples:
Start a new bugtracker project as described in tutorial from scratch, create folders and files as tutorial expose, then do following changes:
1) put Product, Bug, User class files at root level, same level as bootstraps files and create_xxxxx files
so Setup method path argument is considered correctly, Doctrine engine must know where yaml files for classes are.
so Setup method path argument is considered correctly again, Doctrine engine must know where xml files for classes are.
so Setup method path argument IS NOT CONSIDERED, Doctrine engine use already defined classes to get Annotations docblocks using php reflexion classes, methods and functions.
How to deal with this? I mean...
a) Erase path argument from Setup::createAnnotationMetadataConfiguration methos (and similar functions for Annotations) because is not needed, classes and annotations must be defined before.
I know that is easy to follow tutorial guidelines to develop applications in Annotations point of view, load them before Doctrine script start (with require/include or autoloaders, etc) and will work, but I think that is wrong how tutorial and functional logic are given, so a) and b) are my proposed solutions. I think b) should be right, get dockblocks from a class already defined and if are not defined it follow XML and YAML logic: read metadata from other files.
Attachment: My bugtracker Netbeans project.
Sorry by my english