Reputation: 2101
I have the following PHP class structure:
I want to save the objects in a database (MySQL, MSSQL, postgreSQL and all standard providers offer).
My requirements are:
I found some possibilities, but there is no one, that matches all my requirements:
Information:
Finally for me there is no way, but I think there must be a possibility, other portals do it the same way (for example eBay or any small ad portal), probably I have thought about it so much, that I don't see the easiest way.
Is there an approach, that fullfills all requirements?
Thanks for every help (links, keywords, ...) , if something is not clear, just ask.
Upvotes: 4
Views: 297
Reputation: 2760
as you listed no-sql for your research: I do think that would be a very easy solution for you, say mongodb. Your requirements are met for this case and there are neat solutions for object-mappings at hand, Doctrine ODM for example. Also, hosting is definitly available for it, http://dotcloud.com for example. Though I don`t know what budget is availabe to you. With this provider you will start at appr. 8$ a month.
Upvotes: 0
Reputation: 18940
You may not have looked at Class Table Inheritance closely enough. In particular, you should look at how subclass tables get their ID field filled in. It isn't an autonumber. It's a copy of the ID field from the corresponding superclass. This is "poor man's inheritance". It's a little complicated to program the insertion of new items, but the joins you will need are slick, easy, and fast. All you have to do is use the ID of the subclass and the ID of the superclass in the join condition and you're done.
And you can create 5 views to join generalized attributes and specialized attributes for your case.
Upvotes: 1