# |
Jul 17th 2018, 10:12 |
josbeir |
that should be a good thing tho |
# |
Jul 17th 2018, 10:12 |
josbeir |
yes but i think that its still untouched in the afterSave callback and only reset set correctly after |
# |
Jul 17th 2018, 10:12 |
tim |
@josbeir Yes it is set to false once it's saved |
# |
Jul 17th 2018, 10:11 |
dereuromark |
let me check |
# |
Jul 17th 2018, 10:06 |
josbeir |
i'm looking at Table::_onSaveSuccess |
# |
Jul 17th 2018, 10:06 |
josbeir |
so it should be still as is when you do stuff no +? |
# |
Jul 17th 2018, 10:06 |
josbeir |
but i see it happens after the event callback |
# |
Jul 17th 2018, 10:06 |
dereuromark |
would be nice to have this back |
# |
Jul 17th 2018, 10:05 |
dereuromark |
exactly, that is resettet, as such it cant help |
# |
Jul 17th 2018, 10:05 |
josbeir |
@dereuromark isn't the isNew() property set to false after the afterSave() |
# |
Jul 17th 2018, 10:05 |
snake-venom |
if i will develop a large application in cakephp 3 then if they cakephp 4 released then how much it will tough/ feasible to update from cakephp 3 to cakephp 4 ? |
# |
Jul 17th 2018, 10:01 |
dereuromark |
would be nice to have this in options or sth |
# |
Jul 17th 2018, 10:01 |
dereuromark |
I guess I have to also use beforeSave then and a model prop? |
# |
Jul 17th 2018, 10:01 |
dereuromark |
in 2.x we new with $created in afterSave callback if added or modified. In 3.x there seems to be nothing here anymore, right? |
# |
Jul 17th 2018, 09:52 |
josbeir |
just, post validation |
# |
Jul 17th 2018, 09:52 |
josbeir |
indeed |
# |
Jul 17th 2018, 09:52 |
saeideng |
model |
# |
Jul 17th 2018, 09:52 |
josbeir |
after retrieval :P |
# |
Jul 17th 2018, 09:52 |
saeideng |
no |
# |
Jul 17th 2018, 09:52 |
josbeir |
just |
# |
Jul 17th 2018, 09:52 |
josbeir |
sorry |
# |
Jul 17th 2018, 09:52 |
saeideng |
view? |
# |
Jul 17th 2018, 09:51 |
josbeir |
true :slightly_smiling_face: |
# |
Jul 17th 2018, 09:51 |
josbeir |
ah in the view layer |
# |
Jul 17th 2018, 09:51 |
saeideng |
and `setErrors` |
# |
Jul 17th 2018, 09:51 |
saeideng |
`setError` |
# |
Jul 17th 2018, 09:51 |
josbeir |
i'm not sure tho, you should check the docs/code for that |
# |
Jul 17th 2018, 09:50 |
josbeir |
i don't think so |
# |
Jul 17th 2018, 09:46 |
abdualelah.mdy |
@josbeir can I mark both fields as error ? |
# |
Jul 17th 2018, 09:39 |
abdualelah.mdy |
Thank you very much :heart_eyes: |
# |
Jul 17th 2018, 09:39 |
neon1024 |
https://book.cakephp.org/3.0/en/orm/validation.html#creating-unique-field-rules |
# |
Jul 17th 2018, 09:39 |
josbeir |
add that to your buildRules method in your model |
# |
Jul 17th 2018, 09:38 |
josbeir |
$rules->add(new IsUnique([ 'field1, 'field2' ]), 'skuUnique', [ 'errorField' => 'field1', 'message' => __d('admin', 'The item already exists') ]); |
# |
Jul 17th 2018, 09:38 |
abdualelah.mdy |
I have question : How can I check if the combination of 2 columns in my table is unique ? |
# |
Jul 17th 2018, 09:36 |
abdualelah.mdy |
hello everyone |
# |
Jul 17th 2018, 09:34 |
josbeir |
for |
# |
Jul 17th 2018, 09:34 |
josbeir |
:P |
# |
Jul 17th 2018, 09:34 |
josbeir |
i'm going to src/Listeners |
# |
Jul 17th 2018, 09:34 |
neon1024 |
Depends if you like them closer to your models I guess, I just find them harder to find tucked away in other folders |
# |
Jul 17th 2018, 09:34 |
josbeir |
or Listeners |
# |
Jul 17th 2018, 09:34 |
josbeir |
src/Lib/Events |