doctrine / KeyValueStore

Abstraction for Key-Value to Plain Old PHP Object mapping
http://www.doctrine-project.org
MIT License
200 stars 59 forks source link

Mapping drivers #36

Closed EmanueleMinotto closed 9 years ago

EmanueleMinotto commented 9 years ago

Should be a solution (a first draft at least) for #12 and #13

<!-- Doctrine.Tests.KeyValueStore.Functional.Post.dcm.xml -->
<?xml version="1.0" encoding="UTF-8"?>
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping
                          http://raw.github.com/doctrine/doctrine2/master/doctrine-mapping.xsd">
    <entity name="Doctrine\Tests\KeyValueStore\Functional\Post" storage-name="post">
        <id>id</id>
    </entity>
</doctrine-mapping>
# Doctrine.Tests.KeyValueStore.Functional.Post.dcm.yml
Doctrine\Tests\KeyValueStore\Functional\Post:
  storageName: post
  id:
    - id
  transient:
    - foo
    - bar

The identifier can also be a string. A single attribute as identifier should be a common thing (I think).

beberlei commented 9 years ago

Why do you break BC on the Annotations namespaces so drastically? This requires changes to every user for no good reason.

beberlei commented 9 years ago

Its not documented in the PR description that you changed the Annotation namespaces as well

EmanueleMinotto commented 9 years ago

just tried to align it with the same doctrine2 (before a v1 release), anyway no problem, I'm going to move annotations back to Doctrine\KeyValueStore\Mapping\Annotations :+1:

EmanueleMinotto commented 9 years ago

@beberlei done, let me know if I should squash the commits

beberlei commented 9 years ago

@EmanueleMinotto please move the driver back as well into the Doctrine\KeyValueStore\Mapping namespace.

It is not really important to be consistent with ORM here, and it doesn't make a huge difference.

In general, when you do want to break BC, then you should document this in a CHANGELOG.md file, like Symfony does or UPGRADE.md like Doctrine ORM does.