Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added alias mapping option for entity namespaces #18

Merged
merged 5 commits into from
Sep 18, 2013
Merged

Added alias mapping option for entity namespaces #18

merged 5 commits into from
Sep 18, 2013

Conversation

marcojanssen
Copy link
Contributor

Add the alias for a namespace according to the mapping options:

"orm.em.options" => array(
"mappings" => array(
    array(
        "type" => "annotation",
        "namespace" => "Foo\Entity",
        "alias" => 'Foo',
        "path" => __DIR__."/../src/Foo/Entity",
        "use_simple_annotation_reader" => false
    )
)

Adjusted README & added the unit test for the option

@simensen
Copy link
Member

Wow! Thanks for this.

One thing on the docs, though. Is it really just for annotations? It looks like the alias could live next to type and namespace options. Based on the code it looks like it should be able to be called for any of the mapping types. If it is open and should work for all, if you can move it around in the docs I'll merge this. :)

@marcojanssen
Copy link
Contributor Author

Sorry about that, good point, moved it too it's own paragraph

simensen added a commit that referenced this pull request Sep 18, 2013
Added alias mapping option for entity namespaces
@simensen simensen merged commit 93306ed into dflydev:master Sep 18, 2013
@simensen
Copy link
Member

@marcojanssen Thanks! Merged. If you can, please try out @dev to see how it looks and if it is good to go I'll try to tag a new stable tag sometime this week.

@marcojanssen
Copy link
Contributor Author

@simensen It works just fine, works flawless. Using it in https://github.com/marcojanssen/silex-rest

stable tag will definetly be nice!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants