# |
Jan 30th 2014, 20:36 |
BackEndCoder |
thats why you are getting confused |
# |
Jan 30th 2014, 20:36 |
BackEndCoder |
not a Hasmany |
# |
Jan 30th 2014, 20:36 |
the-neon |
as in, doesn't make sense |
# |
Jan 30th 2014, 20:36 |
BackEndCoder |
comments should be a habtm |
# |
Jan 30th 2014, 20:36 |
Fatalnix |
so i'm getting confused about naming conventions. I have a table I am using which sounds plural since s is at the end.. and I remember a strange quirk about this. For example the table name is cms, which is a list of cms's we manage. I have a controller, CmsController.php and when I try to do for example $this->Cms->find('all'); it saus that Cms is not a member of the controller. |
# |
Jan 30th 2014, 20:36 |
the-neon |
no....? |
# |
Jan 30th 2014, 20:35 |
fnfilho |
Please, is there a way I can change the className of a hasMany association dynamically? I have a user hasMany comments association, but many Comments tables (like Comment1, Comment2, Comment3) and I'll know which one by a column on the User Table. Makes sense? |
# |
Jan 30th 2014, 20:35 |
BackEndCoder |
my coffee is called Becks |
# |
Jan 30th 2014, 20:35 |
the-neon |
hey |
# |
Jan 30th 2014, 20:35 |
BackEndCoder |
hello |
# |
Jan 30th 2014, 20:35 |
fnfilho |
Hey Guys! |
# |
Jan 30th 2014, 20:35 |
the-neon |
hey Fatalnix |
# |
Jan 30th 2014, 20:34 |
the-neon |
I need some coffee first |
# |
Jan 30th 2014, 20:34 |
BackEndCoder |
hi |
# |
Jan 30th 2014, 20:34 |
the-neon |
now... time to see how I can use the same view for creating and updating CustomerPrice |
# |
Jan 30th 2014, 20:34 |
Fatalnix |
Hey guys |
# |
Jan 30th 2014, 20:33 |
BackEndCoder |
hasmany models have no s |
# |
Jan 30th 2014, 20:33 |
BackEndCoder |
habtm model names have the s in the middle |
# |
Jan 30th 2014, 20:33 |
the-neon |
yeah, that's the tricky mode |
# |
Jan 30th 2014, 20:33 |
BackEndCoder |
i was thinking of hasbtm joining tables |
# |
Jan 30th 2014, 20:33 |
the-neon |
^_^ |
# |
Jan 30th 2014, 20:33 |
BackEndCoder |
infact no, thats wrong, model names are the same |
# |
Jan 30th 2014, 20:32 |
the-neon |
nu |
# |
Jan 30th 2014, 20:32 |
BackEndCoder |
but model names are the other way |
# |
Jan 30th 2014, 20:32 |
BackEndCoder |
tables names are like that |
# |
Jan 30th 2014, 20:32 |
chris______ |
D |
# |
Jan 30th 2014, 20:32 |
the-neon |
hehe |
# |
Jan 30th 2014, 20:32 |
BackEndCoder |
and lists them out nicely :D |
# |
Jan 30th 2014, 20:32 |
BackEndCoder |
mysql likes them too |
# |
Jan 30th 2014, 20:32 |
BackEndCoder |
yeah |
# |
Jan 30th 2014, 20:32 |
BackEndCoder |
ooo, like hasmanys |
# |
Jan 30th 2014, 20:32 |
the-neon |
cake recognizes those automatically |
# |
Jan 30th 2014, 20:32 |
the-neon |
e.g. customers + customer_categories |
# |
Jan 30th 2014, 20:31 |
the-neon |
In my current app I have lot of these |
# |
Jan 30th 2014, 20:31 |
the-neon |
nope |
# |
Jan 30th 2014, 20:31 |
BackEndCoder |
i can't remember its all a big blur |
# |
Jan 30th 2014, 20:31 |
BackEndCoder |
wouldn't it be the first word in the model name? OrdersItem ? |
# |
Jan 30th 2014, 20:30 |
the-neon |
plural... |
# |
Jan 30th 2014, 20:30 |
chris______ |
ohhh right, since it is a hasmany through model |
# |
Jan 30th 2014, 20:30 |
BackEndCoder |
so the right way round would be a before z |
# |
Jan 30th 2014, 20:30 |
the-neon |
from my current experience only the second word should be plular |