# |
Jul 9th 2019, 09:15 |
conehead |
And I think usually you should be able to perform such tasks with https://github.com/dereuromark/upgrade But currently it seems to only support up to version 3.7 |
# |
Jul 9th 2019, 09:14 |
neon1024 |
:point_up: |
# |
Jul 9th 2019, 09:13 |
conehead |
@info315 Can't your IDE do this? |
# |
Jul 9th 2019, 09:05 |
s.ahmad |
@challgren Thanks :slightly_smiling_face: |
# |
Jul 9th 2019, 09:05 |
challgren |
IDK I suck at Validation |
# |
Jul 9th 2019, 09:05 |
info315 |
Basically i want to string replace all `allowEmptyString` with `allowEmptyStringLegacy` |
# |
Jul 9th 2019, 09:05 |
challgren |
`Validator::addDefaultProvider('custom', 'App\Model\Validation');` wouldnt that work? |
# |
Jul 9th 2019, 09:04 |
info315 |
@challgren Yep i found this as well, but I'm looking for a way where i don't need to modify all files manualy |
# |
Jul 9th 2019, 09:04 |
challgren |
@s.ahmad https://book.cakephp.org/3.0/en/appendices/3-8-migration-guide.html |
# |
Jul 9th 2019, 09:03 |
s.ahmad |
Hey what's new in cake3.8 |
# |
Jul 9th 2019, 09:03 |
challgren |
@info315 https://book.cakephp.org/3.0/en/core-libraries/validation.html#adding-validation-providers |
# |
Jul 9th 2019, 08:59 |
martin |
or authentication middleware |
# |
Jul 9th 2019, 08:46 |
challgren |
Maybe someone else has a better way but thats what I would do |
# |
Jul 9th 2019, 08:44 |
info315 |
Is this the only possible method? |
# |
Jul 9th 2019, 08:43 |
challgren |
Yep |
# |
Jul 9th 2019, 08:43 |
info315 |
But than i would need to modify all my tables to extends my `AppTable` instead of `Table` right? |
# |
Jul 9th 2019, 08:42 |
challgren |
@info315 You could write a “AppTable” class and define it there |
# |
Jul 9th 2019, 08:40 |
slackebot |
``` |
# |
Jul 9th 2019, 08:40 |
info315 |
Is it possible to overwrite the default `Validator` class with an `AppValidator` or some like that? I found this in the docs, but i don't know how to use it. https://book.cakephp.org/3.0/en/core-libraries/validation.html#creating-reusable-validators What I'm trying to achieve is the ability to use this in my Tables: ``` public function validationDefault(Validator $validator) { $validator ->methodFromMyAppValidator('id') |
# |
Jul 9th 2019, 08:34 |
mehov |
I guess the last resort would be running a direct query, but wanted to avoid that |
# |
Jul 9th 2019, 08:34 |
slackebot |
it may not work. It's almost 3 years old, however. Had something changed since then? Is there a more elegant way to accomplish this? |
# |
Jul 9th 2019, 08:34 |
mehov |
Gentlemen, I need to run a query like this: DELETE t1 FROM table1 t1 LEFT JOIN table2 t2 ON ... WHERE t2.id IS NULL Researching how to do that, the closest thing I found is https://stackoverflow.com/questions/39106573/cakephp-3-delete-filtering-by-associated-data/39107054#39107054. Most other answers cover deleting the joined entries, which I don't need. I was thinking `$table->query()->delete()->join()->...`, but the above answer says |
# |
Jul 9th 2019, 08:32 |
martin |
Yes I know, but there is no (working) cakephp plugin for it. So have to build it by my self (with the league library) |
# |
Jul 9th 2019, 08:20 |
neon1024 |
Just `field == 'id'` :slightly_smiling_face: |
# |
Jul 9th 2019, 08:17 |
neon1024 |
`{% elseif columnData.field == 'id' %}` |
# |
Jul 9th 2019, 08:16 |
neon1024 |
I’d like to wrap my numbers in `->Number->format()` but not my `id` field |
# |
Jul 9th 2019, 08:16 |
neon1024 |
How do I detect the `id` field in a bake theme using Twig? |
# |
Jul 9th 2019, 08:10 |
kgb.acct.personal |
I'll keep this in mind |
# |
Jul 9th 2019, 08:07 |
kgb.acct.personal |
Thanks for the tip guys :+1: |
# |
Jul 9th 2019, 08:05 |
admad |
statics are evil |
# |
Jul 9th 2019, 08:05 |
challgren |
@kgb.acct.personal my guess would be for testing mocking |
# |
Jul 9th 2019, 08:05 |
kgb.acct.personal |
TL;DR please? |
# |
Jul 9th 2019, 08:05 |
kgb.acct.personal |
> No.. don't use TableRegistry anymore Why tho? |
# |
Jul 9th 2019, 08:05 |
admad |
guess we havent gotten around to updating all references in cookbook |
# |
Jul 9th 2019, 08:04 |
kgb.acct.personal |
I'll keep in mind to use `loadModel` wherever possible |
# |
Jul 9th 2019, 08:04 |
kgb.acct.personal |
What a twist. `TableRegistry` is often found on the cookbook. |
# |
Jul 9th 2019, 08:03 |
neon1024 |
Oh right |
# |
Jul 9th 2019, 08:03 |
admad |
@neon1024 and then jumped shipped :P j/k. He's employed elsewhere now. |
# |
Jul 9th 2019, 08:01 |
admad |
forget `TableRegistry` even exists |
# |
Jul 9th 2019, 08:01 |
kgb.acct.personal |
Woah. Wait |
# |
Jul 9th 2019, 08:01 |
neon1024 |
@savant gathered them all |