# |
Jun 20th 2018, 12:05 |
josbeir |
i get that, it is my first project now thats using it as primary |
# |
Jun 20th 2018, 12:05 |
lorenzo |
I don’t use ES as a primary store, so this kind of modelling was never desirable to me |
# |
Jun 20th 2018, 12:05 |
lorenzo |
makes stuff very complex, but if you think it is desirable, then go for it |
# |
Jun 20th 2018, 12:04 |
josbeir |
Hey @lorenzo in ES we now have embedOne and embedMany, these get applied on keys on the 'root' document. But with denormalized data its normal to have nesting at a deeper level, what are your toughts on implementing support for embeds on a deeper level, for instance, embedOne('item.nested') ? |
# |
Jun 20th 2018, 11:38 |
unclezoot |
thanks lorenzo |
# |
Jun 20th 2018, 11:37 |
unclezoot |
we're added the action to the $this->Security->setConfig('unlockedActions'... array which is working so that's good enough for me at this moment |
# |
Jun 20th 2018, 11:36 |
unclezoot |
so ive been reading, which suggests one day the component will be deprecated so now is the time to start reading up on it |
# |
Jun 20th 2018, 11:36 |
lorenzo |
in 3.6 the middleware is encouraged |
# |
Jun 20th 2018, 11:36 |
lorenzo |
are you using the component or the middleware |
# |
Jun 20th 2018, 11:35 |
unclezoot |
im trying the latter, reading it from the cookie then passing it in via an ajax post in the header |
# |
Jun 20th 2018, 11:33 |
lorenzo |
or a cookie and header |
# |
Jun 20th 2018, 11:33 |
lorenzo |
usually a cookie, and a form value |
# |
Jun 20th 2018, 11:33 |
lorenzo |
that means that the token needs to be submitted from 2 different sources |
# |
Jun 20th 2018, 11:33 |
lorenzo |
cake implements the double submit algorithm |
# |
Jun 20th 2018, 11:29 |
unclezoot |
what is the correct 3.6 way of correctly passing the CSRF token these days? I was hoping I just had to pass the X-CSRF-Token within the request header, getting the classic "'_Token' was not found in request data" error and I'd prefer not to lock cake down to 3.5 |
# |
Jun 20th 2018, 11:14 |
unclezoot |
right, makes sense. for what im doing (filtered paginate) I've just changed my left join to inner join to keep the results predictable. thanks for the answer |
# |
Jun 20th 2018, 11:11 |
lorenzo |
and aliases usually start with an uppercase |
# |
Jun 20th 2018, 11:11 |
lorenzo |
unclezoot, when cake cannot identify how to convert part of the result to an entity, it keeps the alias from the sql as the key for the array |
# |
Jun 20th 2018, 10:38 |
unclezoot |
sure, that's what im doing - nemind, i can work around it, cheers neon |
# |
Jun 20th 2018, 10:37 |
neon1024 |
I don’t know, I’m asking. I would just var_dump it to see what it’s Type is |
# |
Jun 20th 2018, 10:37 |
unclezoot |
surprised i hadnt noticed that before |
# |
Jun 20th 2018, 10:35 |
unclezoot |
so the resultset is a mix of entities and data? |
# |
Jun 20th 2018, 10:34 |
neon1024 |
_matchingData isn’t an entity? |
# |
Jun 20th 2018, 10:34 |
unclezoot |
morning, quick question: why is the associated model's data returned as lowercase when using 'contain' (left join), but is uppercased when using 'matching' (inner join), specifically within the _matchingData array? |
# |
Jun 20th 2018, 09:54 |
portilloster |
thanks @josbeir |
# |
Jun 20th 2018, 09:47 |
josbeir |
@portilloster if you want to avoid explicit query building check out updateAll => https://book.cakephp.org/3.0/en/orm/saving-data.html#bulk-updates |
# |
Jun 20th 2018, 09:43 |
portilloster |
ok! thanks!! |
# |
Jun 20th 2018, 09:43 |
tim |
`->set(['aceptado' => $aceptado, 'fechaCreacion' => $fecha])` |
# |
Jun 20th 2018, 09:41 |
portilloster |
@tim like this? `->set(['aceptado' => $aceptado],['fechaCreacion' => $fecha])` |
# |
Jun 20th 2018, 09:37 |
tim |
It's an array, just set multiple key => value pairs |
# |
Jun 20th 2018, 09:34 |
portilloster |
File uploaded https://cakesf.slack.com/files/U9CUM170B/FBBQ9SA9M/-.php / https://slack-files.com/T053DPNCM-FBBQ9SA9M-1820140557 |
# |
Jun 20th 2018, 09:34 |
portilloster |
Morning guys!! I found on the documentation how to update data but the example that appears is just with one field. Anyone knows how to update multiple fields using this example below? |
# |
Jun 20th 2018, 09:28 |
josbeir |
i think this should probably be ported to EntityContext too |
# |
Jun 20th 2018, 09:27 |
josbeir |
there was still an issue when creating new nested entities with validation errors as the entity is not available in the parent document, this fixes that too :slightly_smiling_face: |
# |
Jun 20th 2018, 09:25 |
lorenzo |
cool! |
# |
Jun 20th 2018, 09:25 |
josbeir |
@lorenzo i improved the nested validation error checking in documentcontext => https://github.com/cakephp/elastic-search/pull/175 but best to merge after the 3.6.6. rls :slightly_smiling_face: |
# |
Jun 20th 2018, 08:09 |
sadf |
okay thanks, I will look into that |
# |
Jun 20th 2018, 08:09 |
neon1024 |
https://github.com/cakephp/orm |
# |
Jun 20th 2018, 08:09 |
neon1024 |
Yes |
# |
Jun 20th 2018, 08:08 |
sadf |
can I use the cakephp tableRegistry and models as a database library without using the entire cakephp framework ? |
# |
Jun 20th 2018, 07:56 |
josbeir |
morning all |