|
Thursday 19 January 2006 3:49:29 pm
Comment45176
Hi Paul I was thinking that for each new table in the db there should be a class extending from persistantobject with a definition inside which relates the db columns to helper functions for access. Maybe thats overkill but its a nice to have. Then you wouldnt need to use any 'selects'.
Ahh OK, I thought tha might be what you were refering to. These datatypes came about because we have been doing quite a bit of development where we need to integrate existing databases with eZ and converting sites with databases to use eZ content objects. Initially we were creating a custom datatypes in the manor you are talking about - with a corresponding persistantobject elements, and in some cases we still do. Now, where appropriate, we use these datatypes and find it saves quite a bit of time. These datatypes are very handy for long lists and can be used to replace the enum/select datatypes. We have used them for nationality/country lists and I'm sure we have gotten back the time taken in development by not having to enter all that data into the content class! Perhaps you could follow the model of contentclass and have lots of redundant data_ elements which would be used by whatever types of data you needed?
I not sure what you mean here? One improvement I am looking at is looking at the field type of the index column and using that to determine it is gets stored in data_int or data_text - or maybe I can just store it in data_text regardless.
Cheers Bruce
My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish
|