From b88ef8b1a5a30a055e328f89a1b753bf9792fbfe Mon Sep 17 00:00:00 2001 From: Benjamin Eberlei Date: Sat, 15 Oct 2011 09:47:56 +0200 Subject: [PATCH] Add docs on SimplifiedXmlDriver and SimplifiedYamlDriver --- en/reference/xml-mapping.rst | 22 ++++++++++++++++++++++ en/reference/yaml-mapping.rst | 22 ++++++++++++++++++++++ 2 files changed, 44 insertions(+) diff --git a/en/reference/xml-mapping.rst b/en/reference/xml-mapping.rst index 758ff5b7c..5fbfdd1ff 100644 --- a/en/reference/xml-mapping.rst +++ b/en/reference/xml-mapping.rst @@ -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 + + '/path/to/files1', + 'OtherProject\Entities' => '/path/to/files2' + ); + $driver = new \Doctrine\ORM\Mapping\Driver\SimplifiedXmlDriver($namespaces); + $driver->setGlobalBasename('global'); // global.orm.xml + Example ------- diff --git a/en/reference/yaml-mapping.rst b/en/reference/yaml-mapping.rst index 219866e80..e173b2340 100644 --- a/en/reference/yaml-mapping.rst +++ b/en/reference/yaml-mapping.rst @@ -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 + + '/path/to/files1', + 'OtherProject\Entities' => '/path/to/files2' + ); + $driver = new \Doctrine\ORM\Mapping\Driver\SimplifiedYamlDriver($namespaces); + $driver->setGlobalBasename('global'); // global.orm.yml + Example -------