DDC-1373: Map file with specific class #1720

Closed
opened 2026-01-22 13:23:13 +01:00 by admin · 3 comments
Owner

Originally created by @doctrinebot on GitHub (Sep 13, 2011).

Originally assigned to: @Ocramius on GitHub.

Jira issue originally created by user armetiz:

Hi there,
AbsractFileDriver is using the filename to know the managed class.

It's a cool feature because it's allow loading on-demand.
The problem is, that the filename must be the name of the Class.

It should be great to be able to manually map XML/YAML File description to a Class, like :
$drivers->addMappingFile ( array ( "filename" => "class", "filename2" => "class2") );

This feature is simple to implement, just add a new array inside AbsractFileDriver to know the mapping.
When using the current method with addPaths, parse the folder to get traditional XML/YAML file where filename corresponding to classname and add it to the mapping array.

AbsractFileDriver->getAllClassNames () just return value of mapping array.
The mapping array is store inside cache.

With this new feature, it allow developers to create a pretty folder that contains entities mapping.

Armetiz.

Originally created by @doctrinebot on GitHub (Sep 13, 2011). Originally assigned to: @Ocramius on GitHub. Jira issue originally created by user armetiz: Hi there, AbsractFileDriver is using the filename to know the managed class. It's a cool feature because it's allow loading on-demand. The problem is, that the filename must be the name of the Class. It should be great to be able to manually map XML/YAML File description to a Class, like : $drivers->addMappingFile ( array ( "filename" => "class", "filename2" => "class2") ); This feature is simple to implement, just add a new array inside AbsractFileDriver to know the mapping. When using the current method with addPaths, parse the folder to get traditional XML/YAML file where filename corresponding to classname and add it to the mapping array. AbsractFileDriver->getAllClassNames () just return value of mapping array. The mapping array is store inside cache. With this new feature, it allow developers to create a pretty folder that contains entities mapping. Armetiz.
admin added the ImprovementWon't Fix labels 2026-01-22 13:23:13 +01:00
admin closed this issue 2026-01-22 13:23:13 +01:00
Author
Owner

@doctrinebot commented on GitHub (Dec 20, 2011):

Comment created by @guilhermeblanco:

Updating fix version

@doctrinebot commented on GitHub (Dec 20, 2011): Comment created by @guilhermeblanco: Updating fix version
Author
Owner

@malukenho commented on GitHub (Jan 3, 2017):

@guilhermeblanco can it be closed?

@malukenho commented on GitHub (Jan 3, 2017): @guilhermeblanco can it be closed?
Author
Owner

@Ocramius commented on GitHub (Jan 4, 2017):

Indeed, this is better suited for custom mapping drivers, not core.

Closing.

@Ocramius commented on GitHub (Jan 4, 2017): Indeed, this is better suited for custom mapping drivers, not core. Closing.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#1720