# |
Sep 16th 2019, 11:40 |
javier.villanueva |
"The provided value is invalid" |
# |
Sep 16th 2019, 11:40 |
javier.villanueva |
but patchentities always returns invalid values |
# |
Sep 16th 2019, 11:39 |
slackebot |
\Cake\Database\Type::build('datetime')->useLocaleParser()->setLocaleFormat('dd/MM/yyyy HH:mm'); \Cake\Database\Type::build('timestamp')->useLocaleParser()->setLocaleFormat('dd/MM/yyyy HH:mm'); \Cake\Database\Type::build('decimal')->useLocaleParser(); \Cake\Database\Type::build('float')->useLocaleParser() |
# |
Sep 16th 2019, 11:39 |
javier.villanueva |
\Cake\I18n\Time::setToStringFormat([IntlDateFormatter::MEDIUM, IntlDateFormatter::SHORT]); \Cake\I18n\Time::setToStringFormat('dd/MM/YYYY HH:mm'); \Cake\I18n\Date::setToStringFormat('dd/MM/yyyy'); \Cake\I18n\FrozenTime::setToStringFormat('dd/MM/yyyy HH:mm'); \Cake\I18n\FrozenDate::setToStringFormat('dd/MM/yyyy'); \Cake\Database\Type::build('date')->useLocaleParser()->setLocaleFormat('dd/MM/yyyy'); |
# |
Sep 16th 2019, 11:39 |
javier.villanueva |
And in my bootstrap.php |
# |
Sep 16th 2019, 11:38 |
javier.villanueva |
Hi, I have a problem validating my date fields. I am working with dd/MM/yyyy format. |
# |
Sep 16th 2019, 10:19 |
jotpe |
Btw: I set companyConfig in beforeRender() |
# |
Sep 16th 2019, 10:12 |
jotpe |
In my AppController I set some misc. data: `$this->set('companyConfig', Configure::read('company'));` which should be available mostly everywhere. For the views this works perfect. When I now want to send Emails this is not accessible. Do I have to set it on every Mail manually with setViewVars()? Or is there another approach with AppView or so? |
# |
Sep 16th 2019, 10:00 |
admad |
`findLive()` and `findlive()` refers to same method |
# |
Sep 16th 2019, 10:00 |
admad |
@neon1024 it's inline with case insensitivity of methods names in php |
# |
Sep 16th 2019, 09:32 |
neon1024 |
Perhaps it’s my `__call()` method which is non case-sensitive |
# |
Sep 16th 2019, 09:32 |
neon1024 |
Furthermore, I guess this does allow more flexibility in aliasing finders |
# |
Sep 16th 2019, 09:31 |
neon1024 |
I presume it relies on the Registry pattern, so doesn’t really care what the key is |
# |
Sep 16th 2019, 09:31 |
neon1024 |
I think the issue is around the `$this->setConfig('implementedFinders', $anyOldArrayYouLike)` |
# |
Sep 16th 2019, 09:30 |
neon1024 |
`Live === live` :man-shrugging: |
# |
Sep 16th 2019, 09:30 |
neon1024 |
Seems that finders are not case sensitive either |
# |
Sep 16th 2019, 09:11 |
neon1024 |
Nobody wants to maintain that |
# |
Sep 16th 2019, 09:11 |
spriz |
cwap |
# |
Sep 16th 2019, 09:11 |
spriz |
:( |
# |
Sep 16th 2019, 09:11 |
neon1024 |
Hard to do concrete implementation for a list in the datastore |
# |
Sep 16th 2019, 09:10 |
spriz |
:) |
# |
Sep 16th 2019, 09:10 |
spriz |
Nasty |
# |
Sep 16th 2019, 09:10 |
spriz |
Oh |
# |
Sep 16th 2019, 09:10 |
neon1024 |
The methods you mean? I use `__call()` |
# |
Sep 16th 2019, 09:10 |
spriz |
that method name should be `public function findAwatingAudit($query, $options): Query {}` ? |
# |
Sep 16th 2019, 09:10 |
neon1024 |
Perhaps I’ll change the method label string in the behaviour |
# |
Sep 16th 2019, 09:10 |
spriz |
but - but |
# |
Sep 16th 2019, 09:09 |
neon1024 |
I added `$this->find('awaitingAudit')` and got a Missing finder method, and got :S |
# |
Sep 16th 2019, 09:09 |
neon1024 |
It automatically adds finder for me based on my Statuses table |
# |
Sep 16th 2019, 09:09 |
neon1024 |
I add it using a behaviour |
# |
Sep 16th 2019, 09:08 |
spriz |
the custom finder that is |
# |
Sep 16th 2019, 09:08 |
spriz |
@neon1024 how is that method named? |
# |
Sep 16th 2019, 09:08 |
spriz |
@COOurb that should be possible :slightly_smiling_face: |
# |
Sep 16th 2019, 09:07 |
javier.villanueva |
morning all |
# |
Sep 16th 2019, 09:07 |
neon1024 |
My code just generated, a finder called ‘Awaiting audit’, and it works as `$this->find('Awaiting audit')` :thinking_face: |
# |
Sep 16th 2019, 09:07 |
spriz |
@peppejaripappalardo you can do this: https://github.com/UseMuffin/Trash/blob/master/src/Model/Behavior/TrashBehavior.php#L211-L217 |
# |
Sep 16th 2019, 09:07 |
neon1024 |
Not sure if it’s important, but custom finder accept spaces |
# |
Sep 16th 2019, 09:06 |
jotpe |
thanks @spriz |
# |
Sep 16th 2019, 09:03 |
spriz |
right now we have `if ($entity->rule === ''`) { $entity->rule = null; }` in `beforeSave` - feelsbadman |
# |
Sep 16th 2019, 09:02 |
spriz |
How does the ORM decide whether it should put `null` or `''` for a input that is type `string`? :thinking_face: |
# |
Sep 16th 2019, 09:02 |
spriz |
@jotpe `Security::randomString()` :slightly_smiling_face: |