diff --git a/docs/en/reference/advanced-configuration.rst b/docs/en/reference/advanced-configuration.rst index ddb1d03743d..5cd920cc177 100644 --- a/docs/en/reference/advanced-configuration.rst +++ b/docs/en/reference/advanced-configuration.rst @@ -111,14 +111,12 @@ Gets or sets the metadata driver implementation that is used by Doctrine to acquire the object-relational metadata for your classes. -There are currently 4 available implementations: +There are currently 3 available implementations: - ``Doctrine\ORM\Mapping\Driver\AttributeDriver`` - ``Doctrine\ORM\Mapping\Driver\XmlDriver`` - ``Doctrine\ORM\Mapping\Driver\DriverChain`` -- ``Doctrine\ORM\Mapping\Driver\YamlDriver`` (deprecated and will be - removed in ``doctrine/orm`` 3.0) Throughout the most part of this manual the AttributeDriver is used in the examples. For information on the usage of the diff --git a/docs/en/reference/basic-mapping.rst b/docs/en/reference/basic-mapping.rst index ccb2d515bda..ee0cc13065e 100644 --- a/docs/en/reference/basic-mapping.rst +++ b/docs/en/reference/basic-mapping.rst @@ -47,10 +47,9 @@ mapping metadata: - :doc:`Attributes ` - :doc:`XML ` - :doc:`PHP code ` -- :doc:`YAML ` (deprecated and will be removed in ``doctrine/orm`` 3.0.) This manual will usually show mapping metadata via attributes, though -many examples also show the equivalent configuration in YAML and XML. +many examples also show the equivalent configuration in XML. .. note:: diff --git a/docs/en/reference/events.rst b/docs/en/reference/events.rst index ae0de4d0fd1..e0e9ab3bc2c 100644 --- a/docs/en/reference/events.rst +++ b/docs/en/reference/events.rst @@ -906,7 +906,7 @@ Load ClassMetadata Event ``loadClassMetadata`` - The ``loadClassMetadata`` event occurs after the mapping metadata for a class has been loaded from a mapping source -(attributes/xml/yaml) in to a ``Doctrine\ORM\Mapping\ClassMetadata`` instance. +(attributes/xml) in to a ``Doctrine\ORM\Mapping\ClassMetadata`` instance. You can hook in to this process and manipulate the instance. This event is not a lifecycle callback. diff --git a/docs/en/reference/yaml-mapping.rst b/docs/en/reference/yaml-mapping.rst deleted file mode 100644 index bb5feb9b870..00000000000 --- a/docs/en/reference/yaml-mapping.rst +++ /dev/null @@ -1,158 +0,0 @@ -YAML Mapping -============ - -.. warning:: - The YAML driver is deprecated and will be removed in version 3.0. - It is strongly recommended to switch to one of the other mappings. - -The YAML mapping driver enables you to provide the ORM metadata in -form of YAML documents. - -The YAML mapping document of a class is loaded on-demand the first -time it is requested and subsequently stored in the metadata cache. -In order to work, this requires certain conventions: - - -- Each entity/mapped superclass must get its own dedicated YAML - mapping document. -- The name of the mapping document must consist of the fully - qualified name of the class, where namespace separators are - replaced by dots (.). -- All mapping documents should get the extension ".dcm.yml" to - identify it as a Doctrine mapping file. This is more of a - convention and you are not forced to do this. You can change the - file extension easily enough. - -.. code-block:: php - - setFileExtension('.yml'); - -It is recommended to put all YAML mapping documents in a single -folder but you can spread the documents over several folders if you -want to. In order to tell the YamlDriver where to look for your -mapping documents, supply an array of paths as the first argument -of the constructor, like this: - -.. code-block:: php - - 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: - -- File Extension is .orm.yml -- Filenames are shortened, "MyProject\\Entities\\User" will become User.orm.yml -- 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 - - 'MyProject\Entities', - '/path/to/files2' => 'OtherProject\Entities' - ); - $driver = new \Doctrine\ORM\Mapping\Driver\SimplifiedYamlDriver($namespaces); - $driver->setGlobalBasename('global'); // global.orm.yml - -Example -------- - -As a quick start, here is a small example document that makes use -of several common elements: - -.. code-block:: yaml - - # Doctrine.Tests.ORM.Mapping.User.dcm.yml - Doctrine\Tests\ORM\Mapping\User: - type: entity - repositoryClass: Doctrine\Tests\ORM\Mapping\UserRepository - table: cms_users - schema: schema_name # The schema the table lies in, for platforms that support schemas (Optional, >= 2.5) - readOnly: true - indexes: - name_index: - columns: [ name ] - id: - id: - type: integer - generator: - strategy: AUTO - fields: - name: - type: string - length: 50 - email: - type: string - length: 32 - column: user_email - unique: true - options: - fixed: true - comment: User's email address - loginCount: - type: integer - column: login_count - nullable: false - options: - unsigned: true - default: 0 - oneToOne: - address: - targetEntity: Address - joinColumn: - name: address_id - referencedColumnName: id - onDelete: CASCADE - oneToMany: - phonenumbers: - targetEntity: Phonenumber - mappedBy: user - cascade: ["persist", "merge"] - manyToMany: - groups: - targetEntity: Group - joinTable: - name: cms_users_groups - joinColumns: - user_id: - referencedColumnName: id - inverseJoinColumns: - group_id: - referencedColumnName: id - lifecycleCallbacks: - prePersist: [ doStuffOnPrePersist, doOtherStuffOnPrePersistToo ] - postPersist: [ doStuffOnPostPersist ] - -Be aware that class-names specified in the YAML files should be -fully qualified. - -Reference -~~~~~~~~~~~~~~~~~~~~~~ - -Unique Constraints ------------------- - -It is possible to define unique constraints by the following declaration: - -.. code-block:: yaml - - # ECommerceProduct.orm.yml - ECommerceProduct: - type: entity - fields: - # definition of some fields - uniqueConstraints: - search_idx: - columns: [ name, email ] - diff --git a/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.Enums.Card.dcm.yml b/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.Enums.Card.dcm.yml deleted file mode 100644 index 1694c72070f..00000000000 --- a/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.Enums.Card.dcm.yml +++ /dev/null @@ -1,11 +0,0 @@ -Doctrine\Tests\Models\Enums\Card: - type: entity - id: - id: - type: integer - generator: - strategy: AUTO - fields: - suit: - type: string - enumType: Doctrine\Tests\Models\Enums\Suit \ No newline at end of file diff --git a/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.Generic.BooleanModel.dcm.yml b/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.Generic.BooleanModel.dcm.yml deleted file mode 100644 index 5b1ec64b874..00000000000 --- a/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.Generic.BooleanModel.dcm.yml +++ /dev/null @@ -1,11 +0,0 @@ -\stdClass: - type: entity - id: - id: - type: integer - unsigned: true - generator: - strategy: AUTO - fields: - booleanField: - type: boolean diff --git a/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.Upsertable.Insertable.dcm.yml b/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.Upsertable.Insertable.dcm.yml deleted file mode 100644 index 4e5e8531841..00000000000 --- a/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.Upsertable.Insertable.dcm.yml +++ /dev/null @@ -1,17 +0,0 @@ -Doctrine\Tests\Models\Upsertable\Insertable: - type: entity - table: insertable_column - id: - id: - generator: - strategy: AUTO - fields: - nonInsertableContent: - type: string - insertable: false - generated: INSERT - options: - default: 1234 - insertableContent: - type: string - insertable: true \ No newline at end of file diff --git a/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.Upsertable.Updatable.dcm.yml b/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.Upsertable.Updatable.dcm.yml deleted file mode 100644 index 386ae77209b..00000000000 --- a/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.Upsertable.Updatable.dcm.yml +++ /dev/null @@ -1,17 +0,0 @@ -Doctrine\Tests\Models\Upsertable\Updatable: - type: entity - table: updatable_column - id: - id: - generator: - strategy: AUTO - fields: - nonUpdatableContent: - type: string - updatable: false - generated: ALWAYS - options: - default: 1234 - updatableContent: - type: string - updatable: true