mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
Use single entity and map it to multiple tables (dynamically set table name) #5380
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?
Originally created by @noisemaker00 on GitHub (Jan 12, 2017).
Originally assigned to: @lcobucci on GitHub.
I need to map a single entity (eg: CustomersOrdersY.php) to a multiple table, on the base of the year. Inside my class there's a field wich contains the year and I need to save record in the corrisponding table.
Example:
If the year in the class object was set to 2016 I need to save entity in: "customers_orders_2016"
Is that possible with the framework?
@lcobucci commented on GitHub (Jan 12, 2017):
@noisemaker00 that's not supported since it's not the responsibility of an ORM.
I assume that you want to do that because your data increased a lot and everything is slow... if that is the problem you can try to use table partitioning to solve it, like this for MySQL.