# |
Dec 4th 2017, 19:25 |
inoas |
Be back later! trying |
# |
Dec 4th 2017, 19:25 |
inoas |
good. |
# |
Dec 4th 2017, 19:25 |
inoas |
and thats it? |
# |
Dec 4th 2017, 19:24 |
admad |
inoas: load your custom helper in appview with alias "Url" and all other helpers loaded after will use your's instead of core UrlHelper |
# |
Dec 4th 2017, 19:24 |
hmic |
why dont you just use the fullBaseUrl? |
# |
Dec 4th 2017, 19:22 |
inoas |
but it is only loaded indirectly through HtmlHelper and alike |
# |
Dec 4th 2017, 19:22 |
inoas |
hm in cakephp3 I want to replace HtmlHelper->assetUrl() so that all urls generated are prefixed with a domain such as static-domain.tld |
# |
Dec 4th 2017, 19:19 |
hmic |
so lets go on... |
# |
Dec 4th 2017, 19:19 |
obinoob |
regarding that i guess it's all nicely done... |
# |
Dec 4th 2017, 19:18 |
obinoob |
ok fine I was told that you could find cardinality by reading both directions but that will count only to know where to put the foreign key |
# |
Dec 4th 2017, 19:17 |
hmic |
so every belongsTo has a matching hasOne (or hasMany) association in the other table |
# |
Dec 4th 2017, 19:17 |
hmic |
you are looking at the same thing, just from 2 different sides. which side is which is determined by the position of the foreign key. thats it. |
# |
Dec 4th 2017, 19:16 |
hmic |
and which way is the correct way is determined by the table that has the foreign key field alone. nothing else! |
# |
Dec 4th 2017, 19:16 |
hmic |
it's either belongsTo *or* hasOne/-Many side. not both. |
# |
Dec 4th 2017, 19:15 |
hmic |
obinoob, no. it's not |
# |
Dec 4th 2017, 19:15 |
obinoob |
thus my doubt |
# |
Dec 4th 2017, 19:15 |
hmic |
the table the foreign id field is in is the only thing that defines the association - the table that has it, is the belongsTo side, ever, ever, ever. towns hasOne (or Many) addresses in this case |
# |
Dec 4th 2017, 19:15 |
obinoob |
however each address hasOne town_id |
# |
Dec 4th 2017, 19:15 |
obinoob |
ok I've done that, meaning that the column town_id in addresses belongs to towns |
# |
Dec 4th 2017, 19:14 |
hmic |
if it's in the addresses, it's addresses belongsTo towns |
# |
Dec 4th 2017, 19:14 |
obinoob |
Addresses |
# |
Dec 4th 2017, 19:14 |
hmic |
in which table is the town_id field? |
# |
Dec 4th 2017, 19:09 |
obinoob |
hmic I think so, I have a small doubt reading relation between: Addresses "might" have 0 or 1 Towns! Is this not meaning that address should have the following: belongsTo and asOne for town_id ? |
# |
Dec 4th 2017, 19:08 |
hmic |
give it a try |
# |
Dec 4th 2017, 19:07 |
obinoob |
hmic I need to refractor my model relations... I've just notice that I might be missing a few important steps here! Or I might be wrong either... |
# |
Dec 4th 2017, 18:55 |
hmic |
obinoob, paginate addresses table instead of clients |
# |
Dec 4th 2017, 18:50 |
obinoob |
hmic I'm not following... '=( |
# |
Dec 4th 2017, 18:47 |
hmic |
you've got your answers already |
# |
Dec 4th 2017, 18:47 |
hmic |
you dont need to show it again |
# |
Dec 4th 2017, 18:47 |
obinoob |
https://gist.github.com/obinoob/9668db682997c3175ccca2b0a24de257 |
# |
Dec 4th 2017, 18:46 |
hmic |
:D |
# |
Dec 4th 2017, 18:46 |
obinoob |
lol hmic I don't I realize that you have far more important things to do sorry for that |
# |
Dec 4th 2017, 18:45 |
hmic |
do you really think i remeber your model still? :O |
# |
Dec 4th 2017, 18:45 |
hmic |
hint: change your viewpoint to the adresses scope maybe - query this table instead! |
# |
Dec 4th 2017, 18:45 |
obinoob |
*using |
# |
Dec 4th 2017, 18:45 |
obinoob |
hmic I'm it's the same realtional model that you have seen earlier today |
# |
Dec 4th 2017, 18:44 |
hmic |
if its a hasone/belongsto - yes. if it's a hasnmany - no |
# |
Dec 4th 2017, 18:42 |
obinoob |
is it possible to sort data from district->name where Clients hasOne Address->Towns->Districts ? I've tried the following: https://gist.github.com/obinoob/83db63ee87a1b4b39eb53b211fd9f6ad |
# |
Dec 4th 2017, 17:21 |
abik |
thanks |
# |
Dec 4th 2017, 17:20 |
admad |
yes, $this->Foo->Associated->setSaveStrategy() |
# |
Dec 4th 2017, 17:18 |
abik |
can I do it on the fly ? |