Hi, I am building a CakePHP-based application using all the database
tables built by another application. However, the database tables
related to models are defined differently from CakePHP's convention.

We have the following tables: articles, users, ratings for the models:
Article, User, and Rating; the associations among them include the
following, "Article hasOne Rating" and "User hasAndBelongsToMany
Article"

I have the following questions:

1. In the articles table, article_id was used as the column name for
the article id (the primary key). When I try to access ratings records
associated with Article, it generated the following error:

SQL Error: 1054: Unknown column 'Article.id' in 'on clause' in /var/
www/html/cake/cake/libs/model/datasources/dbo_source.php on line 463

I guess CakePHP was expecting the column name to be 'id' in the
articles table. If so, can I work around this problem without changing
the column name?


2. The join table was named as user_articles. According to CakePHP
convention, it should be articles_users. Is there anyway I can
override the CakePHP convention to use user_articles instead? Also
there was an extra field for record id (thus it has three columns: id,
article_id, user_id), can we live with this?

Could anybody help me to resolve the above issues to override the
CakePHP convention? Thanks a lot.

Best regards,
Anch


--~--~---------~--~----~------------~-------~--~----~
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