This should work:
class Contact extends AppModel {
var $hasMany = array(
'Call' = array(
'foreignKey' = false,
'conditions' = array(
'Call.number = Contact.number'
)
)
);
}
hth
grigri
On Jul 9, 12:06 am, Justin Beeler jrble...@gmail.com wrote:
I'm working
I'm working with two tables: Contacts and Calls.
I want to join the calls with the contacts on a field called
number (the phone number). Is there not a way in cake to manually
join tables and not have it join on a field like [model]_id ?
If you need any further details, let me know.
Check out
You can use the join statement:
http://book.cakephp.org/view/1047/Joining-tables )although it's not ideal).
Jeremy Burns
Class Outfit
jeremybu...@classoutfit.com
http://www.classoutfit.com
On 9 Jul 2010, at 00:06, Justin Beeler wrote:
I'm working with two tables: Contacts and Calls.
I
...@gmail.com wrote:
Can you post the code you are using to retrieve and display the data?
On May 12, 3:17 pm, Site Reference daoustm...@gmail.com wrote:
Hey all,
I apologize if this is a bit of a newbie question, but I am having
trouble getting my database associations to link up...here
Can you post the code you are using to retrieve and display the data?
On May 12, 3:17 pm, Site Reference daoustm...@gmail.com wrote:
Hey all,
I apologize if this is a bit of a newbie question, but I am having
trouble getting my database associations to link up...here is what I
have:
MySQL
Hey all,
I apologize if this is a bit of a newbie question, but I am having
trouble getting my database associations to link up...here is what I
have:
MySQL Tables
CREATE TABLE phones (
id INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
profile_id INTEGER UNSIGNED NULL,
phone VARCHAR(255) NULL