Wednesday, November 3, 2010

Re: How strict is your approach towards convention over configuration?

That's really clever AD. I was going to say you can edit all custom
foreign keys in the models and joins and cakephp will play nice, but
creating database views is a pretty slick approach I hadn't thought
of.

Nick

On Nov 3, 8:39 am, AD7six <andydawso...@gmail.com> wrote:
> On Nov 3, 9:32 am, Enno Weichert <enno.weich...@googlemail.com> wrote:
>
> > Hi,
>
> > I have to integrate a very bad legacy database where field names are
> > named inconsistently (like contact, Kontakt, contactID, contact_id,
> > KontaktID etc.) or even randomly ("ext" is in fact a group_id field in
> > one table).
> > I would have to reflect all that in the models so I'd not have to use
> > that crap anymore.
> > So: how many of the fied references in your code are hard-coded? What
> > obstacles will I see? How much can I configure and still play cakephp?
>
> > Thanks,
> > Enno
>
> why don't you just create a view (assuming you can't edit the actual
> tables).
>
> I.e. CREATE OR REPLACE· v_tablename AS as SELECT  funky AS id, ext AS
> group_id .... FROM optionalotherdatabase.tablename
>
> and use that instead of the real table. If you create simple views (no
> joins, basically) you can also update them.
>
> AD

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

No comments: