Log message #4212989

# At Username Text
# Nov 9th 2019, 20:26 mrfeedback contain would give back a result of projects even if there is no connection to projectclosings. And I want to make sure that three isn´t any connection
# Nov 9th 2019, 20:24 hollistergraham123 Why use matching? Why not use contain?
# Nov 9th 2019, 20:21 hollistergraham123 This seems like a real bug
# Nov 9th 2019, 20:21 hollistergraham123 I renamed the association to ProfileImages and it works prefect
# Nov 9th 2019, 20:15 hollistergraham123 Same reult
# Nov 9th 2019, 20:12 mrfeedback Have you tried "Authors.Posts.FeaturedImages" and "Authors.Images" ?
# Nov 9th 2019, 20:11 slackebot1 back results with Projects which are not related. In fixture there is no link between these two entries, but I get back a result which is mega weired
# Nov 9th 2019, 20:11 mrfeedback I have a HABTM relation. And I try to get only results IF there is a link between projcets and projectclosings. like this: ``` $has_projectclosing = $this->find('all') ->matching( 'Projects' , function(Query $q) use($project_id) { return $q->where(['Projects.id' => $project_id]); } ) ->toArray(); debug($has_projectclosing); ``` for some reason I get
# Nov 9th 2019, 20:10 hollistergraham123 Anyone experience something like this>
# Nov 9th 2019, 20:10 hollistergraham123 Hey i’m having an issue where if I include Images in the contain statement for Post it won’t include the Images association on Authors
# Nov 9th 2019, 19:26 mrfeedback if I want to use `matching` with a HABTM relationship, do I need to enter the joinTable for the matching assoc?
# Nov 9th 2019, 18:28 kevin.pfeifer or should i create a simple example and explain everything inside a github issue?
# Nov 9th 2019, 18:27 kevin.pfeifer and in the Table Model for Table 2 ``` $this->belongsTo( 'Table1', [ 'foreignKey' => 'table1_id', ] ); ```
# Nov 9th 2019, 18:11 kevin.pfeifer so therfore my question is: how do i search inside a connnected hasMany connection
# Nov 9th 2019, 18:10 kevin.pfeifer this is inside the Table Model of Table 1 ``` $this->hasMany( 'Table2', [ 'foreignKey' => 'Table2_id' ] ); ```
# Nov 9th 2019, 15:18 ndm @kevin.pfeifer That would only work when `Table2` is associated via `belongsTo` or `hasOne`, using the `join` strategy.
# Nov 9th 2019, 14:27 kevin.pfeifer The Connection in the Model between Table 1 and Table 2 is correct, that is not the problem
# Nov 9th 2019, 14:26 slackebot1 ->like( $conc1, "%$search%" ) ->like( $conc2, "%$search%" ) ->like( $conc3, "%$search%" ) ->like( $conc4, "%$search%" ); } ); ``` But when i search something i get the error: ``` Column not found: 1054 Unknown column 'Table2.first_name' in 'where clause' ``` Therefore CakePHP doesnt seem to perform the join between Table1 and Table2. Do i do something wrong?
# Nov 9th 2019, 14:26 slackebot1 'Table1.company LIKE' => "%$search%", 'Table1.first_name LIKE' => "%$search%", 'Table1.last_name LIKE' => "%$search%", 'Table1.city LIKE' => "%$search%", 'Table2.first_name LIKE' => "%$search%", 'Table2.last_name LIKE' => "%$search%" ] )
# Nov 9th 2019, 14:26 slackebot1 'Table2.last_name' => 'literal' ] ); $conc4 = $q->func() ->concat( [ 'Table2.last_name' => 'literal', ' ', 'Table2.first_name' => 'literal' ] ); return $exp->or( [
# Nov 9th 2019, 14:26 slackebot1 ->concat( [ 'Table1.last_name' => 'literal', ' ', 'Table1.first_name' => 'literal' ] ); // Concatenated Table2 Name $conc3 = $q->func() ->concat( [ 'Table2.first_name' => 'literal', ' ',
# Nov 9th 2019, 14:26 slackebot1 QueryExpression $exp * @var Query $q */ // Concatenated Table1 Name $conc1 = $q->func() ->concat( [ 'Table1.first_name' => 'literal', ' ', 'Table1.last_name' => 'literal' ] ); $conc2 = $q->func()
# Nov 9th 2019, 14:26 kevin.pfeifer Hey Chat, I have a question (current CakePHP 4 Version): I like to perform a concatinated where search on my base table and a connected table. ``` $query = $this->Table1->find( 'all' ) ->contain( ['Table2',] ); $search = $current_request->getQuery( 'search' ); $query->where( function( $exp, $q ) use ( $search ) { /** * @var
# Nov 9th 2019, 09:16 alexdd55976 morning
# Nov 9th 2019, 03:12 francisdoydora nevermind, figured it out :slightly_smiling_face:
# Nov 9th 2019, 02:52 francisdoydora good morning everyone :slightly_smiling_face: ```$this->Auth->identify()``` fails when I put it in a Cell. anyway this can be fixed? error returned is ```Error: Method App\View\Cell\SwitchSidebarCell::__toString() must not throw an exception, caught Error: Could not render cell - Call to a member function identify() on null [/var/www/html/juniorhigh/src/View/Cell/SwitchSidebarCell.php, line 39]```
# Nov 8th 2019, 21:09 sdevore > You can use the second parameter of Router::connect() to provide any routing parameters that are composed of the default values of the route: ``` Router::connect( '/government', array('controller' => 'pages', 'action' => 'display', 5) ); ```
# Nov 8th 2019, 21:06 ricksaccous might need the double star i dunno
# Nov 8th 2019, 21:06 ricksaccous ie just write the link using controller/action params but in routes make it route to /contact/*
# Nov 8th 2019, 21:05 ricksaccous why aren't you using routes to handle this for you
# Nov 8th 2019, 20:56 devito if you use the string I would need to build the query param and concat it it would seem.
# Nov 8th 2019, 20:50 sdevore well you can always just use the string you want. Although is is a bit limiting. Let me look at another project here in a little bit and see if I did anything specific in that project because I am pretty sure I have handled in it differently
# Nov 8th 2019, 20:17 devito i am also using query string params other wise I would just specify the url as a string
# Nov 8th 2019, 20:16 devito got a cake2 html helper question. When using the link function and specifying a controller and action, is there a way to have the url go to the named route declaration instead of the controller/action route? like just go to /contact instead of /pages/contact ?
# Nov 8th 2019, 18:39 samuel.assuncao @amanfulgence what youi want to do specifcally
# Nov 8th 2019, 17:49 amanfulgence help me how create and use middelware
# Nov 8th 2019, 17:18 samuel.assuncao Someone got a idea ?
# Nov 8th 2019, 17:18 slackebot1 associations too, I do not see any example on documentation how i can do that with the cake ORM
# Nov 8th 2019, 17:18 slackebot1 'Plants' ]); But Instead of getting the actual saved value from my table Purchase, I need get the data from the tables from a certain date. Sales Purchases to get volume_vendido -> created date and filter it to the $date(which is YYYY-MM-DD already) I also need the same for Purchases_Transfers (which is volume_transferido) and Purchase_Devolutions (which is volume_devolvido) So I need a where condition which will filter the
# Nov 8th 2019, 17:18 samuel.assuncao $purchases = TableRegistry::get('Purchases')->find() ->where([ 'data_compra <=' => $date, 'volume_comprado + volume_transferido - volume_devolvido - volume_vendido > 0' ]) //certo ->matching('Plants') ->orderAsc('Plants.razao_social') ->orderAsc('Purchases.created') ->contain([ 'Distributors',
# Nov 8th 2019, 17:18 samuel.assuncao Hi guys!