Log message #4264065

# At Username Text
# May 27th 2021, 12:36 kevin.pfeifer so you want to have the same result with either `/review/someaction` as well as `/clerk/someaction`
# May 27th 2021, 12:17 etibor does not seems its enough
# May 27th 2021, 12:17 etibor `$routes->connect('/review/*', ['prefix'=>'clerk']);`
# May 27th 2021, 12:16 etibor i would like to redirect one prefix to another prefix(with all actions and views)
# May 27th 2021, 12:16 etibor hello everyone
# May 26th 2021, 22:12 tyler.adam.lazenby I finally figured it out, there is a nesting label template
# May 26th 2021, 22:10 etibor its not avery good solution since i can not use those values in the Paginate
# May 26th 2021, 22:10 etibor Kevin,ndm thank you for your help, i implemented in not a smooth way, i made a pre query to determine if it is a clerk or a secreter than made the second query , and attached to the main query in the index controller by using $results->map
# May 26th 2021, 22:01 tyler.adam.lazenby how can I change that
# May 26th 2021, 21:59 tyler.adam.lazenby Boo is just so I can easily inpect it
# May 26th 2021, 21:59 tyler.adam.lazenby ```// label specific for radio 'radiolabel' => '<label class="form-check-label" {{attrs}}>{{text}}</label>', // Wrapping container for radio input/label, 'radioWrapper' => '<div class="form-check form-check-radio">Boo {{radiolabel}}</div>',```
# May 26th 2021, 21:59 tyler.adam.lazenby this is what i am trying right now in my custom FormHelper class
# May 26th 2021, 21:59 tyler.adam.lazenby I can't get radio buttons to form properly with my theme. I need to have the label have a certain class and for the radio group to be contained inside a div with another class
# May 26th 2021, 21:52 ndm I'm just not sure if there's still a question pending :upside_down_face:
# May 26th 2021, 21:51 kevin.pfeifer someone is curious about the resolution :)
# May 26th 2021, 21:50 ndm Soooo... what issue did you find?
# May 26th 2021, 21:42 etibor where i can not attach to the query
# May 26th 2021, 21:42 etibor the real issue is by the index page
# May 26th 2021, 21:42 etibor its not a big deal when i need to do it in a view page, i simple make a pre query, and depends on the result make the second
# May 26th 2021, 21:41 etibor okey i may see the issue
# May 26th 2021, 21:37 etibor moment i am going to look for the sql query
# May 26th 2021, 21:37 kevin.pfeifer like ndm said, checking the generated SQL is the first easy thing you can do to see what cakephp does with your connections Otherwise trying to first come up with the pure SQL also helps because we can then try to help you convert that to how that query should be written in cakephp
# May 26th 2021, 21:35 ndm I mean... you can never have both for one review record then, because `class` can only be one of the two values. Is that what you expect? The default join type should be `LEFT`, but if you end up with an `INNER`, you'd never receive anything. So I'd again point to inspecting the queries.
# May 26th 2021, 21:35 etibor when the db field 'class' is internal (in Reviews) its means Clerks
# May 26th 2021, 21:34 etibor when the db field class is external(in Reviews) its means Secreters
# May 26th 2021, 21:33 etibor thank you @kevin.pfeifer your hint
# May 26th 2021, 21:32 etibor its a polymorphic association and point to 2 different models(Secreters and Clerks)
# May 26th 2021, 21:31 ndm So, a polymorphic self-association?
# May 26th 2021, 21:30 etibor thank you @ndm i am not sure, because it was from the ReviewsTable.php file
# May 26th 2021, 21:28 ndm In any case, use debug kit to inspect the generated queries, that might give some clue.
# May 26th 2021, 21:26 ndm Shouldn't the class name for both associations be `Reviews`?
# May 26th 2021, 21:26 etibor probably i have to add a matching but not sure
# May 26th 2021, 21:24 etibor but this is not a complete solution, i dont want to make 2 queries for this
# May 26th 2021, 21:24 etibor when i try to $this->Reviews->find('all')->contain(['Clerks','Secreters']) it does not return the Clerks or the Secreters However separetly its working well $this->Reviews->find('all')->contain(['Clerks']) or $this->Reviews->find('all')->contain(['Secreters'])
# May 26th 2021, 21:22 kevin.pfeifer just FYI: use three ` to create a multiline code block
# May 26th 2021, 21:21 etibor `$this->belongsTo('Clerks', [` 'className'=>'Clerks', 'foreignKey' => 'clerk_id', //'joinType' => 'LEFT', 'conditions'=>['Reviews.class'=>'internal'] ]); $this->belongsTo('Secreters', [ 'className'=>'Secreters', //'joinType' => 'LEFT', 'foreignKey' => 'secr_id', 'conditions'=>['Reviews.class'=>'external'] ]);
# May 26th 2021, 21:20 etibor well i almost implemented the whole, i added the 'class' and 'foreign_key' fields into the db table the issue is came when i tried to contain booth Models THe Model looks like this
# May 26th 2021, 21:18 etibor hello Kevin
# May 26th 2021, 21:17 kevin.pfeifer so you need table inheritance or what?
# May 26th 2021, 21:07 etibor is anyone who have ever worked with polymorphic associations
# May 26th 2021, 21:07 etibor hello everyone