Re: Relationships - HABTM

2009-01-19 Thread brian
That depends on what $this->Recipe->recursive is set to. On Mon, Jan 19, 2009 at 4:34 PM, Steven Wright wrote: > > Hi Brian one more thing for clarification. My expectation is that if I > define the relationships correctly and my DB table are keyed correctly when > I call f

RE: Relationships - HABTM

2009-01-19 Thread Steven Wright
Hi Brian one more thing for clarification. My expectation is that if I define the relationships correctly and my DB table are keyed correctly when I call for a read all from the Recipe model I should all related information from all tables no matter how deep the relationship. Is that correct

RE: Relationships - HABTM

2009-01-19 Thread Steven Wright
Ok I get it. Thanks man I really appreciate your time. Steve -Original Message- From: cake-php@googlegroups.com [mailto:cake-...@googlegroups.com] On Behalf Of brian Sent: Monday, January 19, 2009 1:13 PM To: cake-php@googlegroups.com Subject: Re: Relationships - HABTM Both Recipe

Re: Relationships - HABTM

2009-01-19 Thread brian
ent: Monday, January 19, 2009 12:26 PM > To: cake-php@googlegroups.com > Subject: Re: Relationships - HABTM > > > On Mon, Jan 19, 2009 at 10:57 AM, rhythmicde...@gmail.com > wrote: >> >> I have been making some pretty good headway on defining the >> relationships for my

RE: Relationships - HABTM

2009-01-19 Thread Steven Wright
t: Re: Relationships - HABTM On Mon, Jan 19, 2009 at 10:57 AM, rhythmicde...@gmail.com wrote: > > I have been making some pretty good headway on defining the > relationships for my models. However I am not getting some data that I > expect to get. This may be due to my relationship

Re: Relationships - HABTM

2009-01-19 Thread brian
On Mon, Jan 19, 2009 at 10:57 AM, rhythmicde...@gmail.com wrote: > > I have been making some pretty good headway on defining the > relationships for my models. However I am not getting some data that I > expect to get. This may be due to my relationship definitions or a > misu

Relationships - HABTM

2009-01-19 Thread rhythmicde...@gmail.com
I have been making some pretty good headway on defining the relationships for my models. However I am not getting some data that I expect to get. This may be due to my relationship definitions or a misunderstanding of what CakePHP will do for me. I am hoping one you can point me in the right

Possible Bug With HABTM Relationships ?

2009-01-08 Thread Kyle Decot
I have a Blog Model & I have a Tag Model. The Tag model is a HABTM relationship to the Blog model. If I add some tags to a particular blog post and save it using saveAll and then I go back and then try to remove all the tags, cakePHP will not remove them all. However if I only attempt to remove a

Re: HABTM relationships and ORDER

2009-01-06 Thread Rob Wilkerson
On Jan 6, 9:04 am, Jonathan wrote: > On Jan 5, 12:42 am, Rob Wilkerson wrote: > > > Did you ever find a solution to this? > > Not really. I ended up writing my own SQL-queries (using model- > > >query). > > (Note that the return data from the "query" contains table names - not > model names as

Re: HABTM relationships and ORDER

2009-01-06 Thread Jonathan
On Jan 5, 12:42 am, Rob Wilkerson wrote: > Did you ever find a solution to this? Not really. I ended up writing my own SQL-queries (using model- >query). (Note that the return data from the "query" contains table names - not model names as with "find"). M.v.h. Jonathan --~--~-

Re: HABTM relationships and ORDER

2009-01-04 Thread Rob Wilkerson
Jonathan wrote: > Hi. > > I can see that ORDER'ing related models have been discussed before, > but I haven't found a solution. > > I basically have 3 tables/models: Item, User, Person > > Item has $hasAndBelongsToMany = array('User'); > > and User has $belongsTo = array('Person'); > > Person has

Re: relationships not deleting on saveAll with HABTM

2008-12-23 Thread tekomp
d.wordpress.com/2008/09/24/saving-extra-fields-in-the-jo... > > The data saves, but each time I submit the form, it doesn't delete the > existing relationships in the join table before adding new ones so the > join table keeps on growing.  Both of my models (niche and website) >

relationships not deleting on saveAll with HABTM

2008-12-23 Thread tekomp
Hi, I have a form which is saving data to a join table using the method found here: http://teknoid.wordpress.com/2008/09/24/saving-extra-fields-in-the-join-table-for-habtm-models/ The data saves, but each time I submit the form, it doesn't delete the existing relationships in the join

Re: Relationships

2008-12-22 Thread Webweave
You need the corresponding belongsTo for your hasOne, and then you should get the related data as $this->Ingredient->IngredientType. On Dec 21, 3:55 pm, "rhythmicde...@gmail.com" wrote: > I am having an issue trying to figure out how to get data from a model > that has a relationship with the cu

Relationships

2008-12-21 Thread rhythmicde...@gmail.com
I am having an issue trying to figure out how to get data from a model that has a relationship with the current model. I have an ingredients table and ingredient_types table I have an Ingredients model and an IngredientTypes model I have an IngredientsController and an IngredientTypesController

Re: self referential many to many relationships

2008-12-21 Thread tekomp
Not sure if it would work, but have you tried creating a HABTM relationship with itself? May have to setup your own join table if cake doesn't create a users_users table. On Dec 18, 11:46 am, overture wrote: > If I have a 'users' table which represents a set of employees and I > want to assign

Re: self referential many to many relationships

2008-12-21 Thread Webweave
7;', 'deleteQuery' => '', 'insertQuery' => '' ) ); Where Supervisor extends User (or just replace the className with 'User'). On Dec 19, 8:38 am, overture wrote: > I

Re: self referential many to many relationships

2008-12-19 Thread overture
I had looked at the manual already. Which bit covers 'self' referential relationships? On Dec 19, 1:46 pm, Smelly_Eddie wrote: > http://book.cakephp.org/view/78/Associations-Linking-Models-Together > > On Dec 18, 2:46 pm,overture wrote: > > > > > If I have

Re: self referential many to many relationships

2008-12-19 Thread Smelly_Eddie
http://book.cakephp.org/view/78/Associations-Linking-Models-Together On Dec 18, 2:46 pm, overture wrote: > If I have a 'users' table which represents a set of employees and I > want to assign a given employee mutiple supervisora (who are obviously > also in the 'users' table) then I have a situa

self referential many to many relationships

2008-12-18 Thread overture
If I have a 'users' table which represents a set of employees and I want to assign a given employee mutiple supervisora (who are obviously also in the 'users' table) then I have a situation where there is a self referential relationship. Not only that it is also many to many. How do I achieve th

HABTM relationships and ORDER

2008-12-14 Thread Jonathan
Hi. I can see that ORDER'ing related models have been discussed before, but I haven't found a solution. I basically have 3 tables/models: Item, User, Person Item has $hasAndBelongsToMany = array('User'); and User has $belongsTo = array('Person'); Person has a field "name", and when I retrieve

Re: Help with table relationships

2008-12-09 Thread [EMAIL PROTECTED]
Thanks guys! Your advice was definitely helpful --~--~-~--~~~---~--~~ 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 em

Re: Help with table relationships

2008-12-08 Thread WebbedIT
The issue is that you are overwriting the $hasMany array with each new declaration so only the last hasMany relationship will be created (Upload). As Milmar says you need to group multiple relation types into a single array as follows: var $hasMany = array('Article', 'Event', 'Post', 'Price',

Re: Help with table relationships

2008-12-08 Thread Milmar
I suggest you try the "bake" feature to generate the codes to minimize any syntax issues. About hasMany, it has other parameters that might need to be set, and, I think you cannot define multiple hasMany variables (just put all related models in an array). e.g. class User extends AppModel { var

Help with table relationships

2008-12-08 Thread [EMAIL PROTECTED]
I'm building a basic CMS and I have a 'users' table that is related to more than one other table. The 'users' table is related to these other tables by a '$hasMany' relationship. I did the bare minimum in terms of setting up my models and databases using the $scaffold feature so I could be sure ev

Re: Just getting started and have a problem with relationships

2008-11-28 Thread James.Diss
er? > > > > On Nov 23, 8:10 pm, "James.Diss" <[EMAIL PROTECTED]> wrote: > > > > > controllers; > > > > > users_controller; > > > > > class UsersController extends AppController { > > > >        

Re: Just getting started and have a problem with relationships

2008-11-26 Thread thatsgreat2345
>         var $name = 'Users'; > > >         var $scaffold; > > > > } > > > > posts_controller; > > > > class PostsController extends AppController { > > >         var $name = 'Posts'; > >

Re: Just getting started and have a problem with relationships

2008-11-26 Thread austin
ler { > > var $name = 'Posts'; > > var $scaffold; > > > } > > > 'hitting' the controllers means using the url.http:///posts > > or http:///users > > > As for using Bake...at the m

Re: Just getting started and have a problem with relationships

2008-11-26 Thread James.Diss
>         var $scaffold; > > > > } > > > > posts_controller; > > > > class PostsController extends AppController { > > >         var $name = 'Posts'; > > >         var $scaffold; > > > > } > > >

Re: Just getting started and have a problem with relationships

2008-11-23 Thread James.Diss
      var $name = 'Posts'; > >         var $scaffold; > > > } > > > 'hitting' the controllers means using the url.http:///posts > > or http:///users > > > As for using Bake...at the moment I'm just working with a couple of > >

Re: Just getting started and have a problem with relationships

2008-11-23 Thread James.Diss
.at the moment I'm just working with a couple of > models and controllers, surely throwing views into the mix is going to > complicate the problem I had, which isn't regarding speed or getting > to grips with how this works (I have ten y

Re: Just getting started and have a problem with relationships

2008-11-23 Thread James.Diss
how this works (I have ten years of PHP and 2 years of Java) but being vaguely confused how a small 'unit test' of how cake is supposed to operate is failing so fundamentally. What is this, fifteen lines of application code? Anyhow, thanks for the debug tip; I can see from the resultin

Re: Just getting started and have a problem with relationships

2008-11-22 Thread php.baker
> > // Groups model > >     var $hasMany = array( > >         'UserGroup' => array( > >             'className'     => 'UserGroup', > >             'foreignKey'    => 'group_id', > >             'limit'         => '5', > >  

Re: Just getting started and have a problem with relationships

2008-11-22 Thread James.Diss
=> 'UserGroup', > >             'foreignKey'    => 'group_id', > >             'limit'         => '5', > >             'dependent'     => true > >         ) > >     ); > > >     // Link to users &

Re: Just getting started and have a problem with relationships

2008-11-22 Thread James.Diss
          'limit'         => '5', >             'dependent'     => true >         ) >     ); > >     // Link to users >     var $hasAndBelongsToMany = array( >         'User' => >             array( >                 'className'  

Re: Just getting started and have a problem with relationships

2008-11-22 Thread Rob
'User', 'joinTable' => 'user_groups', 'foreignKey' => 'group_id', 'associationForeignKey' => 'user_id', 'conditions'=> &

Just getting started and have a problem with relationships

2008-11-22 Thread James.Diss
The failing isn't really in understanding the relationships, just something odd is happening that I want to get a perspective on as a beginner. I have two models with backing database tables. The models are; // app/models/User.php class User extends AppModel { var $name =

formHelper, saveAll() and Model relationships

2008-11-20 Thread ZooooomDan
Hi folks, After evaluating Cake for a rather large back office application I think I've fallen in love, yet something still mystifies me regarding the formHelper. Say I have two models (Campaign and Offer), Campaign -> hasMany -> Offer Offer -> belongsTo -> Campaign When editing a campaign rec

Re: Saving self-referential-HABTM relationships...

2008-09-30 Thread wallerdm
Ha Ha! Started again from scratch using the Cake Bake console and it all seems to be working. A few errors again when adding friends but should be fixable. In case it's of use to anyone here's how it's all set up now... DATABASE... Users table... id | username | password Profiles table... id |

Re: Saving self-referential-HABTM relationships...

2008-09-30 Thread wallerdm
Thanks Bernardo - that makes sense. I think I might drop the concept of admirers and have an "accepted" state for friendships. This all works well when displaying user data, a user model automatically has data about previous friendships but I still can't add new friends. The best I can get when I

Re: Saving self-referential-HABTM relationships...

2008-09-29 Thread Bernardo Vieira
I imagine it should work if you use different join tables for each HABTM relationship. Regardless of cakephp this is what I imagine you'd need in this situation (imagine what would happen if a user is both a friend and an admirer of another user). var $hasAndBelongsToMany = array(

Saving self-referential-HABTM relationships...

2008-09-29 Thread wallerdm
Dear All, Forgive me if this is covered elsewhere. I'm playing with cakePHP as an alternative to Rails and am getting to grips with it by creating a really simple social network app. I've got some nice authentication and user profiles sorted and that's all displaying great but now I've come to a

Re: "Has ..." relationships help please

2008-09-12 Thread David C. Zentgraf
Weights belongsTo both Categories and Courses Categories hasMany Weights Courses hasMany Weigths BelongsTo means the model that belongsTo something also has the foreign keys "in itself" (Weights.course_id). For hasMany THE OTHER model is supposed to have the foreign key (Courses hasMany Weigh

"Has ..." relationships help please

2008-09-12 Thread soldier.coder
I am getting lost in semantics and need a guide. I'm writing an app that keeps track of grades for students in multiple courses. Depending on the type of course, there will be different categories of grades ('Lab Assignments','Oral Presentation', 'Programming Assignments', ...) and there will be

Re: relationships, joins and pagination. I've hit a wall.

2008-08-25 Thread Ariel Arjona
The issue is basically that I have 2 models (Sample and FormationsSite) that share the same parent (Site) and are in turn related to each other by virtue of 1 field on one (Sample.depth) and 2 fields on the other (FormationsSite.formtop and FormationsSite.formbot). I need some way to express that

Re: relationships, joins and pagination. I've hit a wall.

2008-08-24 Thread David C. Zentgraf
Your question is a bit long, so I'm not quite sure what you're asking. It sounds to me like you're having trouble finding() stuff with the condition being on an associated model? For HABTMs or very deeply nested associations Cake indeed doesn't seem to handle it very gracefully yet. I recently

relationships, joins and pagination. I've hit a wall.

2008-08-24 Thread Ariel Arjona
What I'm trying to model is the following: I have a number of Sites which represent wells. From these sites at certain depths Samples are collected. Each Sample contains a number of different Subjects (specimens) found in varying quantities. These are represented by the SubjectHits model in the Su

Re: Database relationships etc

2008-08-24 Thread fuSEboX
learn. :) But You've done great job by understanding and answering all those questions. :P This post cleared many things out and I'll make this post my road map for relationships. And currently I don't have any questions...just lots of testing now. :) --~--~-~--~~

Re: Database relationships etc

2008-08-24 Thread RichardAtHome
Nothing to add apart from props to Rafael for an excellent answer. On Aug 23, 2:05 am, Rafael Bandeira aka rafaelbandeira3 <[EMAIL PROTECTED]> wrote: > Oh, I almost slept, you should try to more clear and less verborragic, > so many explanation just messed up things more and more... > And you sho

Re: Database relationships etc

2008-08-22 Thread Rafael Bandeira aka rafaelbandeira3
Oh, I almost slept, you should try to more clear and less verborragic, so many explanation just messed up things more and more... And you should do 2 things when you can't speak a language : 1) look for groups with the same language of yours and 2) say your nacionality, so members from the same co

Database relationships etc

2008-08-22 Thread fuSEboX
Hi, First post here and also that text was right "probably this question has been asked before" etc. :) I must say that first experiences with Cake are wonderful... seems to save lots of time. Although, one part is totally confusing for me...it's the hasOne, hasMany, belongsTo... part. So I deci

Many-to-Many Relationships with 3 tables. Auth and Acl

2008-08-18 Thread Reza Muhammad
Hi All, I've been following lately, and I must say I'm very pleased with the framework. Currently, I'm having a different project where there should be many to many relationships between 3 tables. This particular situation is for user management purposes. The User r

Re: Cake bake does not recognize relationships?

2008-07-16 Thread Mech7
hange the > textbox to a drop down select list. > > On Jul 15, 10:35 pm, "Renan Gonçalves" <[EMAIL PROTECTED]> wrote: > > > Recognize relationships based on InnoDB relationships is planned to CakePHP > > 2.0.https://trac.cakephp.org/wiki/Proposals/2.0ToDoList

Re: Cake bake does not recognize relationships?

2008-07-16 Thread RichardAtHome
Try putting some data in your groups table. Cake will change the textbox to a drop down select list. On Jul 15, 10:35 pm, "Renan Gonçalves" <[EMAIL PROTECTED]> wrote: > Recognize relationships based on InnoDB relationships is planned to CakePHP > 2.0.https://trac.cake

Re: Cake bake does not recognize relationships?

2008-07-15 Thread Renan Gonçalves
Recognize relationships based on InnoDB relationships is planned to CakePHP 2.0. https://trac.cakephp.org/wiki/Proposals/2.0ToDoList []'s On Tue, Jul 15, 2008 at 4:07 PM, Mech7 <[EMAIL PROTECTED]> wrote: > > Does anybody know what could be wrong.. if I would bake my mode

Cake bake does not recognize relationships?

2008-07-15 Thread Mech7
Does anybody know what could be wrong.. if I would bake my model / controllers / views for users it will just put a input text box for usergroup_id and in the model it just says: Here is the table setup.. --- CREAT

Re: Probably a simple question on table relationships

2008-02-25 Thread Vitved
Thanks for the pr(); tip. Made me get a grip on the whole relationship thing. My dogsizes were actually hasMany and my races were belongsTo, not the other way around as I started out. I think I get the concept now. Thanks for the nudge! Also, some really nice association info in the cookbook. --

Re: Probably a simple question on table relationships

2008-02-24 Thread Dardo Sordi Bogado
Try a pr(); of the data fetched from db, also have a look at : http://manual.cakephp.org (specially the blog tutorial) http://book.cakephp.org On 2/24/08, Vitved <[EMAIL PROTECTED]> wrote: > > Hi everyone > > I'm doing a website for a friend, and wanted to try out cakephp, but > i've ended up

Probably a simple question on table relationships

2008-02-24 Thread Vitved
Hi everyone I'm doing a website for a friend, and wanted to try out cakephp, but i've ended up in a dead-end. I have a table containing dog-races. Some of the characteristics of a given race is referred to another table e.g. size. I've figured out how to grab the data in the "size" table and use

Re: relationships problem

2008-02-21 Thread alkemann
Category hasMany Post , Post belongsTo Category , Post belongsTo Locality posts table must have these two fields: category_id locality_id On Feb 17, 7:04 pm, andrewharlan <[EMAIL PROTECTED]> wrote: > hello, > i understand Post hasone category and hasone locality. but can i set > category to $b

Re: One-to-many and one-to-one relationships between the same two tables...

2008-02-18 Thread AD7six
On Feb 18, 5:26 am, dasn <[EMAIL PROTECTED]> wrote: > I have a situation that I'm not sure how to build the cake model > relationships for. > > I have two tables, Companies and Contacts. A Company can have many > contacts but it also has one primary contact. I figure

relationships problem

2008-02-18 Thread andrewharlan
hello, i understand Post hasone category and hasone locality. but can i set category to $belongsto Post and locality as $belongsto Post ?? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to

relationships problem

2008-02-18 Thread andrewharlan
Can any1 help me with this? i understand Post $hasone category and $hasone locality. but can i set category to $belongsto Post and locality as $belongsto Post ?? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake

One-to-many and one-to-one relationships between the same two tables...

2008-02-18 Thread dasn
I have a situation that I'm not sure how to build the cake model relationships for. I have two tables, Companies and Contacts. A Company can have many contacts but it also has one primary contact. I figured I would set up hasMany and belongsTo entries for the Company and Contact models

Re: Head around Relationships

2008-01-26 Thread Jeremi
Ok, I may have figured out what I really want to do... Instead of the HABTM relationship between games and players, i can just access each other through the score, since every player has to have a score in the game... Still correct? --~--~-~--~~~---~--~~ You recei

Re: Head around Relationships

2008-01-26 Thread Jeremi
Actually... what I can do is instead of looping through $player['Game'] I can loop through $player['Score'] which will contain details about my game... Is this how I would do this correctly? --~--~-~--~~~---~--~~ You received this message because you are subscribed

Head around Relationships

2008-01-26 Thread Jeremi
New to cake here... using 1.2 I've got three models: Players Games Scores class Player extends AppModel { public $name = 'Player'; public $hasAndBelongsToMany = array('Game'); public $hasMany = array('Score'); } class Game extends AppModel { public $name = 'Game';

Re: ternary and binary relationships together

2008-01-26 Thread pipi69e5
Hy Joaquín! The base of my datamodel was wrong :( I wrote: "I have three models (entities): A, B and C ", but either of them is not an entity, only an attribute! When I was seeing the repeated values in the same field of different records, I sed: "Let's normalize it!" and I made a new entity

Re: Why are HABTM 'with' relationships auto-deleted on Model::save() ??

2008-01-24 Thread [EMAIL PROTECTED]
24, 2:48 pm, "[EMAIL PROTECTED]" > > <[EMAIL PROTECTED]> wrote: > > I'm back to thinking I'm right...someone please prove me wrong here. > > > If $fieldList is specified for Model::save() shouldn't it at least > > THEN ignore the 'with&#x

Re: Why are HABTM 'with' relationships auto-deleted on Model::save() ??

2008-01-24 Thread nate
king I'm right...someone please prove me wrong here. > > If $fieldList is specified for Model::save() shouldn't it at least > THEN ignore the 'with' relationships? It currently does the DELETE > query even in this case. > > The only other option is saveField()

Re: Why are HABTM 'with' relationships auto-deleted on Model::save() ??

2008-01-24 Thread [EMAIL PROTECTED]
I'm back to thinking I'm right...someone please prove me wrong here. If $fieldList is specified for Model::save() shouldn't it at least THEN ignore the 'with' relationships? It currently does the DELETE query even in this case. The only other option is saveField() bu

Re: Why are HABTM 'with' relationships auto-deleted on Model::save() ??

2008-01-24 Thread [EMAIL PROTECTED]
yeah that seems like a logical thing to do On Jan 24, 1:30 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hey Eric, why don't you just use saveField() in this situation? > > On Jan 24, 1:20 pm, "[EMAIL PROTECTED]" > > <[EMAIL PROTECTED]>

Re: Why are HABTM 'with' relationships auto-deleted on Model::save() ??

2008-01-24 Thread [EMAIL PROTECTED]
Hey Eric, why don't you just use saveField() in this situation? On Jan 24, 1:20 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I don't know why HABTM relationships are deleted automatically on a > Model::save() in the first place, but is this really necessar

Why are HABTM 'with' relationships auto-deleted on Model::save() ??

2008-01-24 Thread [EMAIL PROTECTED]
I don't know why HABTM relationships are deleted automatically on a Model::save() in the first place, but is this really necessary for the 'with' relationships too? They are practically standalone models so shouldn't there be an option to preserve the current 'with'

Re: ternary and binary relationships together

2008-01-22 Thread Joaquín Windmüller
hey pipe69e5 could you explain how did you do? On Jan 23, 6:22 am, pipi69e5 <[EMAIL PROTECTED]> wrote: > Hy AD! > > A little bit of thinking and the problem are working out :) Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

Re: ternary and binary relationships together

2008-01-22 Thread pipi69e5
Hy AD! A little bit of thinking and the problem are working out :) Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscri

Re: ternary and binary relationships together

2008-01-22 Thread AD7six
On Jan 22, 1:49 am, pipi69e5 <[EMAIL PROTECTED]> wrote: > Hi, I'm new in cakePHP (and in database modeling (and in english:) > too)! > > I have three models (entities): A, B and C. > A hasAndBelongsToMany B, > A hasAndBelongsToMany C and > B hasAndBelongsToMany C > All of this join-tables has ow

ternary and binary relationships together

2008-01-21 Thread pipi69e5
Hi, I'm new in cakePHP (and in database modeling (and in english:) too)! I have three models (entities): A, B and C. A hasAndBelongsToMany B, A hasAndBelongsToMany C and B hasAndBelongsToMany C All of this join-tables has own attributes and I have a "biggest" ABC join table with own attributes to

Re: Modeling Recursive Relationships

2007-11-29 Thread Adam Royle
I'm not sure if I understand your question... with lists and sublists etc, but I did something similar with events and sub-events. Your "lists" table should contain something like (id, parent_id, name, account_id). class List extends AppModel { var $name = 'List'; var $belongsTo

Re: Modeling Recursive Relationships

2007-11-28 Thread Comida411
Hi Thank you for your response.. The data model I presented is the logical model not the physical model.. The physical model is set to have the pks all id.. but its easier to keep track of things when modeling the logical model with pks using the full name... You mentioned that this might be the

Re: Modeling Recursive Relationships

2007-11-28 Thread AD7six
On Nov 28, 7:45 pm, Comida411 <[EMAIL PROTECTED]> wrote: > My question is complicated so I made a web page detailing my > questionhttp://warmeskimo.com/cakerecur/ > Thank you Isn't that the same as any other self referencing relationship that works in cake without anything specific? <- hint.

Modeling Recursive Relationships

2007-11-28 Thread Comida411
My question is complicated so I made a web page detailing my question http://warmeskimo.com/cakerecur/ Thank you --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to c

HABTM weirdness when no relationships are specified

2007-11-01 Thread Deane
I know I'm not the first to notice this, but I can't find a solution -- My HABTM works fine if there's at least one relationship. In these cases, Cake deletes everything from the interstitial table and inserts the specified relationships. However, if there are NO relationships,

Re: Doing INNER JOIN with Cake's relationships

2007-09-28 Thread AD7six
On Sep 28, 2:06 am, neromir <[EMAIL PROTECTED]> wrote: > Hi, > > I've got a few tables that I'm trying to join using Cake's built in > relationship setup. I have a users table, comments table, and comment > type table. I'm trying to show all of the comments to a moderator and > as such have se

Doing INNER JOIN with Cake's relationships

2007-09-27 Thread neromir
Hi, I've got a few tables that I'm trying to join using Cake's built in relationship setup. I have a users table, comments table, and comment type table. I'm trying to show all of the comments to a moderator and as such have set up a hasOne relationship from the comment table for both the user

Re: Searching across HABTM relationships

2007-08-31 Thread Mech7
It seems that there is a new WITH thingy in models there are some more people asking questions about this (including myself) As there is not much info about it except the presentation of 1.2 :( On Aug 31, 4:44 am, KingJackaL <[EMAIL PROTECTED]> wrote: > I should have searched less API/manual/Goog

Re: Searching across HABTM relationships

2007-08-30 Thread KingJackaL
I should have searched less API/manual/Google, and more in this group :x. The solution has been posted several times here - with the way I've fixed it having been posted by Tijs Teulings here: http://groups.google.com/group/cake-php/browse_thread/thread/f23b1825050ad543/014092749592de70?rnum=3#01

Searching across HABTM relationships

2007-08-29 Thread KingJackaL
I've done a fair amount of searching (5+ hours) on this, but I just cannot work it out. Consider a set of entities associated like so: Category <(HABTM)> Listing <(HABTM)> Location Now, in a controller a search for all Listing's can be done as so (this works fine): $this->Listing->findAll();

Re: Help visualising relationships

2007-08-12 Thread kabturek
e with an id, agent_ref, > and area_id - but no matter what I do, I can't seem to get the system > to work. > > I'm struggling to see how the relationships work in this model - can > anyone advise? --~--~-~--~~~---~--~~ You received this mess

Help visualising relationships

2007-08-10 Thread [EMAIL PROTECTED]
ruggling to see how the relationships work in this model - can anyone advise? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com

chaining belongsTo relationships

2007-07-17 Thread laptop
In models... MemberTeam belongsTo Team Team belongsTo Upload However when I query MemberTeam it retrieves the Team table but doesn't get the Upload table.. i have tried setting the recursive option but it still doesn't work?? is there any way to do this? --~--~-~--~~~-

Re: Unbind Model, Relationships and hasMany

2007-07-09 Thread Grant Cox
I'm not sure what you are asking. If a User has no Images, then they won't be retrieved - why bother unbinding? If you have some Users that can have images, and another class of Users where images are completely unrelated - then surely there just won't be any associated images, so why unbind? T

Unbind Model, Relationships and hasMany

2007-07-09 Thread Jonathan Holloway
Hi all, I've got a bit of a query, I have a relationship between a User and an object I'm modelling whereby a user may have an image associated which them as follows: class User { // Define relationship with images with object_id as the key in images var $hasMany = array('photograp

Re: Simple Database Relationships

2007-06-29 Thread zombie's head
Thanks for the quick response! I was lazy on the model names in the message. In my code they are named according to the conventions. Made the changes, and everything works! Thank you so much Walker & Ketan! --~--~-~--~~~---~--~~ You received this message because

Re: Simple Database Relationships

2007-06-29 Thread Ketan Patel
Well, I was saying hasMany with regards to Language and Country Models. Though you are correct the Issues must have 'belongsTo' instead of 'hasOne' Ketan Walker Hamilton wrote: > Also: > > Issue belongsTo (not hasMany) > > > Ketan is correct on the Language & Country classes --~--~-~--

Re: Simple Database Relationships

2007-06-29 Thread Walker Hamilton
Also: Issue belongsTo (not hasMany) Ketan is correct on the Language & Country classes --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.

Re: Simple Database Relationships

2007-06-29 Thread Ketan Patel
You need to have 'hasMany' defined in the Language and Country class. Also, your table names are not following the cake convention either. Table names must be plural and not singular. View http://cakephp.org/files/cakesheet.pdf for more information. zombie's head wrote: > Ahoy-hoy, > > I've stu

Simple Database Relationships

2007-06-29 Thread zombie's head
Ahoy-hoy, I've stumbled upon a simple database relationship problem that is turning out to not be so simple to solve. Here's the situation I'm setting up: An Issue has an associated Language and Country. I figure by putting a key to the Language and Country tables in the Issue, and defining the

Re: Question about model relationships

2007-03-01 Thread Anthony
Thanks, that solved the problem!! - Anthony --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send emai

Re: Question about model relationships

2007-03-01 Thread AD7six
On Mar 1, 6:02 pm, "Anthony" <[EMAIL PROTECTED]> wrote: > OK, I'm aware this is probably a very dumb, newbie question, but you > gotta start somewhere, right? > > Say I have a "users" table and a "messages" table. For each ONE user, > there are MULTIPLE messages. However, when doing a findAll on

<    1   2   3   4   >