# |
Apr 25th 2017, 18:13 |
ypnos |
so, in fact, it is there |
# |
Apr 25th 2017, 18:12 |
ypnos |
doug__: because it is part of StringTemplateTrait which is used by PaginatorHelper |
# |
Apr 25th 2017, 18:07 |
doug__ |
Does anyone know why the documentation says to use '$this->Paginator->setTemplates' but that function does not exist? |
# |
Apr 25th 2017, 17:45 |
ypnos |
for all dirty fields I think you need getDirty() which is available since 3.4.3 |
# |
Apr 25th 2017, 17:45 |
adityapansari |
Actually I want all dirty fields. I am using cakephp 3.3 |
# |
Apr 25th 2017, 17:44 |
ypnos |
in cake3 you call dirty with a single argument and it returns true or false |
# |
Apr 25th 2017, 17:43 |
adityapansari |
? |
# |
Apr 25th 2017, 17:43 |
adityapansari |
Any alernative |
# |
Apr 25th 2017, 17:43 |
adityapansari |
How can I call the getDirty() in cakephp 3.3 ? |
# |
Apr 25th 2017, 17:36 |
ypnos |
in newest cakephp, isDirty() to check, setDirty() to set |
# |
Apr 25th 2017, 17:34 |
adityapansari |
Hey, alternative for dirty() function ? I also want to access the dirty value after saving the entity. |
# |
Apr 25th 2017, 17:32 |
chris-andre |
I forgot about saveMany(), so I will probably use that method. |
# |
Apr 25th 2017, 17:31 |
chris-andre |
Quite simple change. I tested something similar, if `save()` failed, but it didn't give me the result I expected. I probably did something wrong. |
# |
Apr 25th 2017, 17:29 |
chris-andre |
Okay. Thanks for looking at it ;) I'll read your comment on my gist ;) |
# |
Apr 25th 2017, 17:26 |
ypnos |
with comment I meant a comment on your gist :) |
# |
Apr 25th 2017, 17:25 |
ypnos |
see https://book.cakephp.org/3.0/en/orm/saving-data.html#saving-multiple-entities |
# |
Apr 25th 2017, 17:25 |
ypnos |
but for your simple use case, you should use saveMany() |
# |
Apr 25th 2017, 17:24 |
ypnos |
as I said, you need to propagate the negative result of save() so that transactional() can act upon the failure and rollback the transaction |
# |
Apr 25th 2017, 17:23 |
ypnos |
I made a comment on how to fix the code |
# |
Apr 25th 2017, 17:22 |
chris-andre |
Sure. |
# |
Apr 25th 2017, 17:22 |
ypnos |
do some googling on xdebug php :) |
# |
Apr 25th 2017, 17:22 |
chris-andre |
xdebug(): call to undefined method. |
# |
Apr 25th 2017, 17:21 |
chris-andre |
Allright, doesn't get it. Here my method: https://gist.github.com/chris-andre/af7981db40095016c815800e1c56b15c |
# |
Apr 25th 2017, 17:17 |
ypnos |
you can use xdebug |
# |
Apr 25th 2017, 17:17 |
chris-andre |
? |
# |
Apr 25th 2017, 17:17 |
chris-andre |
Sorry for asking stupidly, but what do I do to debug my callback |
# |
Apr 25th 2017, 17:15 |
ypnos_ |
saving entities with an error fails and returns false, but you need to propagate it in the callback |
# |
Apr 25th 2017, 17:15 |
chris-andre |
I thought the transaction would fail if any entity has an error, but it doesn't. |
# |
Apr 25th 2017, 17:15 |
ypnos_ |
how does your callback look like? maybe show a gist? |
# |
Apr 25th 2017, 17:14 |
chris-andre |
Maybe I just haven't been able to make the transaction fail. |
# |
Apr 25th 2017, 17:13 |
ypnos_ |
chris-andre where does the failure happen then? you need to check the results of operations within your callback or propagate the return value, e.g. save() returns false on failure |
# |
Apr 25th 2017, 17:11 |
chris-andre |
@ypnos_ It looks like it return `null` regardless |
# |
Apr 25th 2017, 17:10 |
ypnos_ |
chris-andre catch exceptions and also check the return value of transactional() for false, both means not successful. https://api.cakephp.org/3.0/class-Cake.Database.Connection.html#_transactional |
# |
Apr 25th 2017, 16:21 |
chris-andre |
Hello! Is it a way to check if a `$table->connection()->transactial()` is successful or not? |
# |
Apr 25th 2017, 15:59 |
awi |
The file uploader somehow falls with Hash::get receiving anything but an array or arrayaccess |
# |
Apr 25th 2017, 15:57 |
awi |
Maybe someone can help me with this one: https://github.com/FriendsOfCake/cakephp-upload |
# |
Apr 25th 2017, 15:48 |
awi |
hi. is josegonzalez somewhere around? |
# |
Apr 25th 2017, 15:16 |
inoas |
though I liked the Session Containers |
# |
Apr 25th 2017, 15:15 |
inoas |
I had to work with ZF2 this week... horrible :( |
# |
Apr 25th 2017, 15:15 |
inoas |
I am pretty sure we could be more strict, not sure if it would be overall better though ;) |
# |
Apr 25th 2017, 15:15 |
inoas |
just imagine we had no auto tables, no auto entities, accessible being set to default, fieldLists always required, CSRF always on, http disallowed (only https) etc ;P |