# |
Oct 8th 2018, 13:47 |
rrd564 |
ok I iwll try it |
# |
Oct 8th 2018, 13:47 |
ricksaccous |
so you prob need two different query objects of the same query, maybe |
# |
Oct 8th 2018, 13:46 |
ricksaccous |
if that makes sense |
# |
Oct 8th 2018, 13:46 |
ricksaccous |
it's going to pass the query by reference |
# |
Oct 8th 2018, 13:46 |
ricksaccous |
and do a collection on it |
# |
Oct 8th 2018, 13:46 |
ricksaccous |
basically any time you call the base query object |
# |
Oct 8th 2018, 13:46 |
ricksaccous |
hmmm |
# |
Oct 8th 2018, 13:46 |
ricksaccous |
passed the other way, lol |
# |
Oct 8th 2018, 13:45 |
ricksaccous |
so i think queries are passed by reference, but once you get out of the query it would then have to be uhhhh |
# |
Oct 8th 2018, 13:43 |
rrd564 |
@ricksaccous https://pastebin.com/GCw8Dbd9 |
# |
Oct 8th 2018, 13:37 |
ricksaccous |
@rrd it's hard to understand your implementation and why what's happening is happening without seeing some code |
# |
Oct 8th 2018, 13:36 |
rrd564 |
I need an entity in 2 different collection, but I want to change one property in one collection. As they contains the same entity it changes in the other one. How to prevent this? |
# |
Oct 8th 2018, 13:36 |
madbbb |
@ricksaccous thank you, both of your suggestions work. I forgot to put 'CombinedOrders.name' in select() as well.Now everything works as expected. |
# |
Oct 8th 2018, 13:21 |
ricksaccous |
well, same principle |
# |
Oct 8th 2018, 13:20 |
madbbb |
sorry, it's not CombinedRecords its CombinedOrders |
# |
Oct 8th 2018, 13:20 |
ricksaccous |
it would be 'Trackings' => ['queryBuilder' => function(){}, 'CombinedRecords' |
# |
Oct 8th 2018, 13:19 |
ricksaccous |
so instead of 'Trackings' => function |
# |
Oct 8th 2018, 13:19 |
ricksaccous |
i believe but that query function in a queryBuilder key of the array in combined |
# |
Oct 8th 2018, 13:19 |
ricksaccous |
or you could |
# |
Oct 8th 2018, 13:19 |
ricksaccous |
$q->contain(['CombinedRecords']) |
# |
Oct 8th 2018, 13:18 |
ricksaccous |
you can put it directly in the query |
# |
Oct 8th 2018, 13:17 |
madbbb |
Hello. I have a contain condition in my query, but I don't understand how to get associated record here. I need to get Trackings.CombinedRecords association. Where should I put contain(['CombinedRecords ']). Tried to insert it everywhere with no luck |
# |
Oct 8th 2018, 12:33 |
spencdev |
For most, yeah. |
# |
Oct 8th 2018, 12:33 |
dereuromark |
even though I find this pretty obvious :P |
# |
Oct 8th 2018, 12:32 |
dereuromark |
@spencdev good call yeah. thats why I use the pipe. |
# |
Oct 8th 2018, 12:31 |
CakeEater |
So I can't install cakephps TestSuite as a standalone ? |
# |
Oct 8th 2018, 12:30 |
CakeEater |
As far as I can see there is no stand alone version of cakePHPs test part |
# |
Oct 8th 2018, 12:29 |
CakeEater |
I use the standalone orm from cakephp for a websocket server (ratchet) and im using phpUnit for my tests, I would like to use the fixtures cakePHP generates. |
# |
Oct 8th 2018, 12:26 |
lubos |
it seems that `patchEntity` is doing `query->firstOrFail` before patching, is that possible? |
# |
Oct 8th 2018, 12:04 |
spencdev |
It should probably just be noted that whatever is being used as a delimiter couldn't be used as a search parameter |
# |
Oct 8th 2018, 12:04 |
spencdev |
I'd agree, pretty rare. I think most people would use it as `,` though, which could cause some issues |
# |
Oct 8th 2018, 12:00 |
dereuromark |
we could always add escaping options into it too, not sure if worth it, though |
# |
Oct 8th 2018, 11:59 |
dereuromark |
I think | is rather similarly rare in actual use |
# |
Oct 8th 2018, 11:59 |
dereuromark |
same thing with the wildcards :slightly_smiling_face: |
# |
Oct 8th 2018, 11:59 |
dereuromark |
thats the point. yo need to configure it manually per use case. |
# |
Oct 8th 2018, 11:51 |
spencdev |
what if you're literally looking for something with | in it? |
# |
Oct 8th 2018, 11:42 |
dereuromark |
@admad etc: Can I have quick feedback on https://github.com/FriendsOfCake/search/pull/240 ? So I could write a few tests? |
# |
Oct 8th 2018, 11:17 |
neon1024 |
perhaps cast to array and use `array_column()` |
# |
Oct 8th 2018, 11:17 |
rrd564 |
@neon1024 thanks |
# |
Oct 8th 2018, 11:17 |
neon1024 |
Or convert to array and use `array_unique` |
# |
Oct 8th 2018, 11:16 |
neon1024 |
https://book.cakephp.org/3.0/en/core-libraries/collections.html#Cake\Collection\Collection::groupBy |