# |
Feb 3rd 2018, 22:38 |
davinci |
how do I "increase the depth"? |
# |
Feb 3rd 2018, 22:37 |
hmic |
but sometimes you need to tell it |
# |
Feb 3rd 2018, 22:37 |
hmic |
cake usually guesses your types very well |
# |
Feb 3rd 2018, 22:37 |
hmic |
it makes a hell lot of a difference if you bound value is 0 or '0' |
# |
Feb 3rd 2018, 22:36 |
hmic |
but, i am very certain it does, but it's of the wrong type! |
# |
Feb 3rd 2018, 22:36 |
hmic |
to see it in the dump, just increase the depth |
# |
Feb 3rd 2018, 22:36 |
hmic |
:D |
# |
Feb 3rd 2018, 22:36 |
hmic |
! |
# |
Feb 3rd 2018, 22:36 |
hmic |
i can tell you? |
# |
Feb 3rd 2018, 22:36 |
davinci |
trying to determine why the query doesn't appear to be using the value I think it should be using |
# |
Feb 3rd 2018, 22:34 |
hmic |
davinci: whats the usecase? |
# |
Feb 3rd 2018, 22:33 |
davinci |
Cake 3's query object has 'sql', which you can get by `->sql()`, and it also has 'params', which I cannot figure out how to access. Details of my problem here. Any help GREATLY appreciated. https://stackoverflow.com/questions/48602025/how-to-get-params-from-query-object-in-cakephp-3 |
# |
Feb 3rd 2018, 22:11 |
hmic |
rather a nice explanation on who to think of working with the tree... |
# |
Feb 3rd 2018, 22:11 |
hmic |
;) |
# |
Feb 3rd 2018, 22:11 |
ahmed_bodi |
thats a nice solution |
# |
Feb 3rd 2018, 22:10 |
hmic |
this way you can get a tree of all users of you app too :D |
# |
Feb 3rd 2018, 22:10 |
hmic |
just make evey user level 1 below your "app" root-node |
# |
Feb 3rd 2018, 22:10 |
ahmed_bodi |
hm? how so? |
# |
Feb 3rd 2018, 22:10 |
hmic |
you dont need that |
# |
Feb 3rd 2018, 22:10 |
hmic |
why? |
# |
Feb 3rd 2018, 22:09 |
ahmed_bodi |
each user would be a root node |
# |
Feb 3rd 2018, 22:09 |
ahmed_bodi |
for now yes, in the future nope |
# |
Feb 3rd 2018, 22:08 |
hmic |
there is only one root node in the table, isn't it? :p |
# |
Feb 3rd 2018, 22:07 |
ahmed_bodi |
:P |
# |
Feb 3rd 2018, 22:07 |
ahmed_bodi |
haha, would do if i wasnt allowing user signups |
# |
Feb 3rd 2018, 22:05 |
hmic |
just dont insert the root through the ORM :p |
# |
Feb 3rd 2018, 22:05 |
ahmed_bodi |
@hmic the default buildrules for my model, its checking existsIn for the parent_id but its set to null as it should for the root node, safe to remove? |
# |
Feb 3rd 2018, 22:00 |
greenjam94 |
Setting the display field works perfectly, thanks for the help (and for answering my earlier question) |
# |
Feb 3rd 2018, 21:59 |
hmic |
additionally, you can change the find('list') call in the controller and provide the valueField parameter to its options array, to specify which field to use |
# |
Feb 3rd 2018, 21:59 |
greenjam94 |
ah! I'll try that |
# |
Feb 3rd 2018, 21:58 |
hmic |
you can change it there |
# |
Feb 3rd 2018, 21:58 |
hmic |
greenjam94: it populates the display field from the table |
# |
Feb 3rd 2018, 21:58 |
greenjam94 |
ahmed_bodi: I need to clarify, this is a select control, not a regular text input. I need to change the name of each select option, it's pulling the wrong column from the entity |
# |
Feb 3rd 2018, 21:57 |
hmic |
jason001, no worries |
# |
Feb 3rd 2018, 21:56 |
ahmed_bodi |
no worries :) |
# |
Feb 3rd 2018, 21:56 |
ahmed_bodi |
wanted to avoid coding it up until i knew the structure worked for what i wanted |
# |
Feb 3rd 2018, 21:56 |
jason001 |
so should I just copy-paste my apology from above? thank you hmic |
# |
Feb 3rd 2018, 21:56 |
hmic |
there is a method to do so (regenerate from either lft/rgt or parent_id) |
# |
Feb 3rd 2018, 21:56 |
hmic |
hint: it will be enough to populate the parent_id and let cake fix the tree |
# |
Feb 3rd 2018, 21:55 |
hmic |
ahmed_bodi, you dont need to manually populate them. you should read the docs on how the tree works |
# |
Feb 3rd 2018, 21:55 |
hmic |
jason001, yes, you do, usually... which makes that not so much a cake question :P |