# |
Jul 10th 2019, 07:56 |
lorenzo |
For example |
# |
Jul 10th 2019, 07:56 |
inoas |
where(['NOT' => $conditions]) |
# |
Jul 10th 2019, 07:55 |
lorenzo |
if you negate the condition, I think you can use notMatching() |
# |
Jul 10th 2019, 07:54 |
inoas |
(Tariffs=Products) |
# |
Jul 10th 2019, 07:54 |
inoas |
$query->innerJoinWith('TariffsManufacturers.Manufacturers', function ($query) use ($conditions) { |
# |
Jul 10th 2019, 07:53 |
inoas |
products m:n manufacturers obviously |
# |
Jul 10th 2019, 07:53 |
inoas |
if I switch to leftJoinWith I will get the product even if there is no match |
# |
Jul 10th 2019, 07:52 |
inoas |
at the moment I am using innerJoinWith + contain, which means if there is no relation I do not get a product |
# |
Jul 10th 2019, 07:51 |
inoas |
Say I got a product and want to filter by its manufacturer - if the manufacturer matches: return the product, if there is no relation: return the product, if there is a relation but it does not match: do not return the product |
# |
Jul 10th 2019, 07:50 |
lorenzo |
Or to keep |
# |
Jul 10th 2019, 07:50 |
lorenzo |
if the record exists you want to filter out? |
# |
Jul 10th 2019, 07:50 |
inoas |
let me fix that: I want to filter by associated records' field values if they exist |
# |
Jul 10th 2019, 07:49 |
inoas |
so as a brief term: I want to filter by associated records IF they exist |
# |
Jul 10th 2019, 07:48 |
lorenzo |
on mobile now |
# |
Jul 10th 2019, 07:47 |
inoas |
jose_zap / lorenzo around by chance ;)? |
# |
Jul 10th 2019, 07:47 |
inoas |
do I need to wrap the inneJoin in a subquery? |
# |
Jul 10th 2019, 07:45 |
inoas |
should I use sub queries and use exists/notexists? |
# |
Jul 10th 2019, 07:43 |
inoas |
LEFT JOIN seems to return records even if there is no match |
# |
Jul 10th 2019, 07:43 |
inoas |
aka INNER JOIN or NULL |
# |
Jul 10th 2019, 07:43 |
inoas |
however if there is no matching relation I want to still return the parent query result |
# |
Jul 10th 2019, 07:43 |
inoas |
so I got some innerJoin/matchings going - thus if I put a field=value condition only records with that condition would return |
# |
Jul 10th 2019, 07:42 |
inoas |
hello |
# |
Jul 10th 2019, 07:24 |
felix.robaglia |
Actually it works as the input gets autocomplete=off, but it completes it anyways |
# |
Jul 10th 2019, 07:21 |
felix.robaglia |
I tried 'autocomplete' => 'off' but it doesn't seem to work |
# |
Jul 10th 2019, 07:21 |
felix.robaglia |
Hello ! Is there an easy way to set autocomplete to off with form control ? this is my line of code : $this->Form->control('password', ['label' => 'password']); |
# |
Jul 9th 2019, 18:51 |
brian493 |
shame I had to rewrite my code in PDO to find that out haha |
# |
Jul 9th 2019, 18:51 |
brian493 |
ended up just removing my auto-increment id (really don't need it for what I'm doing to this data) and now cake transactions work |
# |
Jul 9th 2019, 18:50 |
brian493 |
you'd think making a non-transaction capable call would throw a fatal error, not silently exit the transaction and continue running queries |
# |
Jul 9th 2019, 18:49 |
brian493 |
dang |
# |
Jul 9th 2019, 18:49 |
brian493 |
figured it out, I was resetting auto increment which basically breaks transactions in mysql |
# |
Jul 9th 2019, 18:43 |
devito |
is it possable to set up a mysql tunnel in 3.x? |
# |
Jul 9th 2019, 18:43 |
half2me |
bit the weird part is it doesnt fail when the atomicity is false |
# |
Jul 9th 2019, 18:34 |
genellern |
Yeah, I also had the same issue when it had to rollback a transaction, I'll try it again on Friday and let you know what I find |
# |
Jul 9th 2019, 18:17 |
gunner1095 |
I doubt it would take more than a couple of hours to diagnose. Anyway, good luck! Sorry I couldn't help. |
# |
Jul 9th 2019, 18:15 |
brian493 |
it'll take me longer to diagnose cake than it will to rewrite my code with PDO :P I was just hoping there was something obvious someone here might point out |
# |
Jul 9th 2019, 18:14 |
gunner1095 |
If you have debug kit installed you can view the sql logs there. If not, you could enable query logging and then examine the log files to see if there are any clues. |
# |
Jul 9th 2019, 18:13 |
brian493 |
I'm just using PDO directly |
# |
Jul 9th 2019, 18:13 |
brian493 |
I have transactions working on other (non-cake) apps on this machine |
# |
Jul 9th 2019, 18:12 |
brian493 |
idk |
# |
Jul 9th 2019, 18:12 |
gunner1095 |
And there are no hints to what the problem is in the query log, or debug log? |
# |
Jul 9th 2019, 18:11 |
brian493 |
it's problematic because I'm generating about a million rows and it takes a while and I don't want my users to see incomplete data while the script runs |