Details
-
Type:
Documentation
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 2.1
-
Fix Version/s: 2.2
-
Component/s: Documentation
-
Security Level: All
-
Labels:None
-
Environment:LINUX doctrine2.git
Description
In http://www.doctrine-project.org/docs/orm/2.1/en/tutorials/getting-started-xml-edition.html
in Section: Obtaining the EntityManager
the Code:
//$driverImpl = new Doctrine\ORM\Mapping\Driver\XmlDriver(_DIR_."/config/mappings/xml");
$driverImpl = new Doctrine\ORM\Mapping\Driver\XmlDriver(_DIR_."/config/mappings/yml");
//$driverImpl = $config->newDefaultAnnotationDriver(_DIR_."/entities");
produces:
PHP Fatal error: Class 'Sandbox\Doctrine\ORM\Mapping\Driver\XmlDriver' not found in ..
Should be corrected to:
$driverImpl = new \Doctrine\ORM\Mapping\Driver\XmlDriver(_DIR_."/config/mappings/yml");
produces:
PHP Fatal error: Uncaught exception 'Doctrine\ORM\Mapping\MappingException' with message 'No mapping file found named 'Entities.User.dcm.xml' ..
Should be corrected to:
$driverImpl = new \Doctrine\ORM\Mapping\Driver\YamlDriver(_DIR_."/config/mappings/yml");
and finally, following the xml yaml Entities folder structure in the sandbox, should be corrected to:
$driverImpl = new \Doctrine\ORM\Mapping\Driver\YamlDriver(_DIR_."/yaml");
With this configuration I was able to create Entities from yaml through these commands:
- doctrine orm:generate-entities ./
- doctrine orm:schema-tool:create
This issue was already solved in 2.2....
The tutorial code changed due to the new support introduced in 2.2, so I'm marking as fixed and assigning to this middle point version.
Cheers,