1
0
mirror of synced 2025-01-31 12:32:59 +03:00

Add docs on SimplifiedXmlDriver and SimplifiedYamlDriver

This commit is contained in:
Benjamin Eberlei 2011-10-15 09:47:56 +02:00
parent 9c389a49c7
commit b88ef8b1a5
2 changed files with 44 additions and 0 deletions

View File

@ -64,6 +64,28 @@ of the constructor, like this:
$driver = new \Doctrine\ORM\Mapping\Driver\XmlDriver(array('/path/to/files1', '/path/to/files2'));
$config->setMetadataDriverImpl($driver);
Simplified XML Driver
~~~~~~~~~~~~~~~~~~~~~
The Symfony project sponsored a driver that simplifies usage of the XML Driver.
The changes between the original driver are:
1. File Extension is .orm.xml
2. Filenames are shortened, "MyProject\Entities\User" will become User.orm.xml
3. You can add a global file and add multiple entities in this file.
Configuration of this client works a little bit different:
.. code-block:: php
<?php
$namespaces = array(
'MyProject\Entities' => '/path/to/files1',
'OtherProject\Entities' => '/path/to/files2'
);
$driver = new \Doctrine\ORM\Mapping\Driver\SimplifiedXmlDriver($namespaces);
$driver->setGlobalBasename('global'); // global.orm.xml
Example
-------

View File

@ -39,6 +39,28 @@ of the constructor, like this:
$driver = new YamlDriver(array('/path/to/files'));
$config->setMetadataDriverImpl($driver);
Simplified YAML Driver
~~~~~~~~~~~~~~~~~~~~~
The Symfony project sponsored a driver that simplifies usage of the YAML Driver.
The changes between the original driver are:
1. File Extension is .orm.yml
2. Filenames are shortened, "MyProject\Entities\User" will become User.orm.yml
3. You can add a global file and add multiple entities in this file.
Configuration of this client works a little bit different:
.. code-block:: php
<?php
$namespaces = array(
'MyProject\Entities' => '/path/to/files1',
'OtherProject\Entities' => '/path/to/files2'
);
$driver = new \Doctrine\ORM\Mapping\Driver\SimplifiedYamlDriver($namespaces);
$driver->setGlobalBasename('global'); // global.orm.yml
Example
-------