Hi folks. Relatively new to Cake, and so far I'm really enjoying using
it. I built a mini-app over the last few days as a training exercise
that would have normally taken a few weeks in plain PHP. :)

My issue is this. I have a legacy database that I'm working with, and
I'm building a Cake app to use that legacy DB. Because there are other
applications that still use the DB, I can't change the field names to
use the standard cake conventions. This isn't a problem for the most
part, since the model can be configured to handle most of the changes
(table names, primary keys, associations) ... except (at least as far
as I've been able to determine) the 'created' and 'modified' columns.

I dug through the 1.2 source, and found the code blocks in the Model
class that look for those columns (lines 1092 - 1111 and lines 1142 -
1145 for those that are interested). They're currently hardcoded. I
could easily create new model properties to handle variable column
names (something like model->createdColumn and model->modifiedColumn
that could be set akin to the model->useTable and model->primaryKey
properties) on a model by model basis, that would default to the
current 'created', 'modified' and 'updated' column names. Before doing
so, my questions are thus:

a) I'm using the 1.2 beta - if I go the route of changing the base
Model class, I guess I'd have to make sure to update the model
whenever I update my cake version. I tried to see if there was a
better way to deal with this specific change (I'm usually hesitant to
update lib for this very reason), but couldn't figure one out. Is
there something obvious I missed? (Or has someone already done
something like this for these columns?)

b) If I did go ahead and make this change, would this be something
useful to submit as an enhancment ticket? (I looked, but didn't see
any tickets with this feature already).

Thanks,

-r

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to