# |
May 30th 2016, 02:20 |
LckyBy517 |
sounds likea project for tomorrow LOL |
# |
May 30th 2016, 02:20 |
LckyBy517 |
dang, ok well this is gonna take a bit hahah XD |
# |
May 30th 2016, 02:20 |
voycey |
hasOne / Many and belongsTo |
# |
May 30th 2016, 02:20 |
voycey |
cake has no way of knowing what tables it links to - it doesnt read database contraints |
# |
May 30th 2016, 02:20 |
LckyBy517 |
this->has(One/Many) for each dang table? |
# |
May 30th 2016, 02:19 |
LckyBy517 |
like i was starting to do hmmm |
# |
May 30th 2016, 02:19 |
voycey |
you are going to have to build your associations your self |
# |
May 30th 2016, 02:18 |
LckyBy517 |
well crap, anyway i could make it use the UUID for this purpose? can't change the database because the app i didn't make and i don't understand the devs code to just do it myself |
# |
May 30th 2016, 02:18 |
voycey |
yeah so basically your associations are built in database with generic names |
# |
May 30th 2016, 02:18 |
LckyBy517 |
and another |
# |
May 30th 2016, 02:18 |
LckyBy517 |
http://pastebin.com/QbcRtLJe |
# |
May 30th 2016, 02:17 |
voycey |
no because it doesnt match cakes conventions |
# |
May 30th 2016, 02:17 |
LckyBy517 |
so something cakephp won't pick up on though? |
# |
May 30th 2016, 02:17 |
voycey |
post more of the schemas |
# |
May 30th 2016, 02:17 |
voycey |
they could be related through the uuid I guess |
# |
May 30th 2016, 02:16 |
voycey |
thats fine |
# |
May 30th 2016, 02:16 |
LckyBy517 |
stats_players being the main table that only has uuid and name columns |
# |
May 30th 2016, 02:15 |
LckyBy517 |
there is one of the tables |
# |
May 30th 2016, 02:15 |
LckyBy517 |
http://pastebin.com/1pWzJeiz |
# |
May 30th 2016, 02:15 |
voycey |
paste your schema into gist |
# |
May 30th 2016, 02:15 |
voycey |
but its not necessarily wrong to have no associations (it would be a bit strange but not always wrong) |
# |
May 30th 2016, 02:14 |
voycey |
its like saying that id 7 in the posts table is related to id 7 in the comments table |
# |
May 30th 2016, 02:14 |
voycey |
if your tables dont have foreign keys in them then you are basically trying to relate records based on their primary key which cant work |
# |
May 30th 2016, 02:13 |
voycey |
well that doesnt sound right |
# |
May 30th 2016, 02:11 |
LckyBy517 |
if i look at the relations view in phpmyadmin yeah, it shows that uuid is related to the main table uuid field |
# |
May 30th 2016, 02:08 |
voycey |
if so then they have logical relations |
# |
May 30th 2016, 02:08 |
voycey |
do your tables have foreign keys in them? |
# |
May 30th 2016, 02:05 |
LckyBy517 |
hows come cake doesn't pickup on the relation |
# |
May 30th 2016, 02:05 |
LckyBy517 |
if i go to one of the tables the UUID field is clickable and it brings me to the main table |
# |
May 30th 2016, 02:04 |
LckyBy517 |
actually they are linked.... |
# |
May 30th 2016, 02:04 |
LckyBy517 |
ugh, this is gonna be painful |
# |
May 30th 2016, 02:03 |
voycey |
it still needs a model but the model wont have any associations |
# |
May 30th 2016, 02:01 |
LckyBy517 |
it won't pull in the data will it? |
# |
May 30th 2016, 02:00 |
voycey |
if they dont have a logical relationship between the table then there is little point in trying to force one |
# |
May 30th 2016, 01:58 |
LckyBy517 |
so in my code for the main table i want to do $this->has(One/Many) and then state the relationship right? then in all those other models i want to just put this->belongsTo correct? |
# |
May 30th 2016, 01:57 |
LckyBy517 |
let me ask this silly question before i get too far and find out i'm backasswards, i've got a database with this particular app that has 35 tables.... 1 of them has a UUID and name columns, the other 34 tables just have UUID and then the data, there are no realtionships defined either sadly |
# |
May 29th 2016, 22:26 |
MohammadSaleh |
$data['ip'] = $controller->request->clientIp(); |
# |
May 29th 2016, 22:26 |
MohammadSaleh |
all of fields saved success but ip is null |
# |
May 29th 2016, 22:26 |
MohammadSaleh |
LckyBy517, but didnot saving it |
# |
May 29th 2016, 22:25 |
MohammadSaleh |
i have try to save ip value to a field named "ip" in table |
# |
May 29th 2016, 22:24 |
LckyBy517 |
? |