mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
[PR #208] [CLOSED] Allow entity name filtering by regexp in doctrine:mapping:import. #7866
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/doctrine/orm/pull/208
Author: @thunderer
Created: 11/30/2011
Status: ❌ Closed
Base:
master← Head:master📝 Commits (2)
c1f4849allow entity name filtering by regexp in doctrine:mapping:importf3ae9fbchanged regexp delimiters from / to # as it could conflict with namespaced entity names📊 Changes
1 file changed (+2 additions, -1 deletions)
View changed files
📝
lib/Doctrine/ORM/Tools/Console/MetadataFilter.php(+2 -1)📄 Description
While working on a Symfony2 project I found it extremely useful to be able to filter entity names by regexp when importing entities to YAML metadata. This small commit makes it possible without any BC breaks or something. I've written about it on my blog: http://blog.kowalczyk.cc/2011/11/11/symfony2-importing-entity-mapping-data-using-regular-expression-filters/ .
Without this commit:
Imports everything that contains "Category" or "User" in its name. With my commit:
Imports only wanted entities. And you can use both ways simultaneously, because
preg_match("/{name}/")does the same asstrpos("{name}");.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.