Re: connecting the many to many dots - going from table1 -> table1_table2 -> table 2

2008-11-26 Thread kai

Thank you. Searching for 'modelizing the join table' brought me to the
Mariano Iglesias article "Modelizing HABTM join tables in CakePHP 1.2:
with and auto-with models".
here: 
http://www.cricava.com/blogs/index.php?blog=6&title=modelizing_habtm_join_tables_in_cakephp_&more=1&c=1&tb=1&pb=1

This talks about how to call the models manually, which is a start,
but I need the conditions to come from the user through the use of a
form.

One of the examples is this: $joinRecords = $this->Article-
>ArticlesTag->find('all', array('ArticlesTag.tag_id' => 3));
Where the ArticlesTag.tag_id => 3 can i replace 3 with an array? As I
said before, when I call $this->data I get an array of category id's
that the user has chosen so something along the lines of placing that
data into a variable and the variable in the 3 position seems to be
about what i need. Except for that this doesn't work and I'm not sure
what else to try.

Kyo wrote:
> You can retrieve data from a HABTM relationship either by modelizing
> the join table or using 'with' key of the model association.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: connecting the many to many dots - going from table1 -> table1_table2 -> table 2

2008-11-25 Thread Kyo

You can retrieve data from a HABTM relationship either by modelizing
the join table or using 'with' key of the model association.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



connecting the many to many dots - going from table1 -> table1_table2 -> table 2

2008-11-25 Thread kai

I realize my question leans more towards learning php than it does the
cakephp framework but it's a little of both and i'm trying to learn
both so I hope someone is willing to help.

I have three tables: categories, categories_listings, and listings. i
have a form that lists categories with check boxes. if one is check
marked and the submit button is hit i am taken to the form action and
in data is the category id of the check marked category.

How do I go from having a category id, to finding which records match
that category id in the categories_listings table, to returning the
listings that are associated with that category id?
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---