# |
Jan 4th 2019, 21:45 |
ricksaccous |
because if the entity field itself within the other entity has an error |
# |
Jan 4th 2019, 21:44 |
ricksaccous |
so it can't place errors on them anyway |
# |
Jan 4th 2019, 21:44 |
ricksaccous |
i think without validating the parent it won't hydrate the hasMany as entities |
# |
Jan 4th 2019, 21:44 |
ricksaccous |
hmph that still didn't put an error on the child array in the entity |
# |
Jan 4th 2019, 21:43 |
phantomwatson |
Then all rules will be checked |
# |
Jan 4th 2019, 21:42 |
phantomwatson |
Don't mark the rule as `'last' => true`. |
# |
Jan 4th 2019, 21:42 |
ricksaccous |
hwo do you prevent execution from being stopped |
# |
Jan 4th 2019, 21:42 |
ricksaccous |
i don't understand your question |
# |
Jan 4th 2019, 21:42 |
phantomwatson |
Or how to prevent it from being validated? |
# |
Jan 4th 2019, 21:42 |
ricksaccous |
nooooo |
# |
Jan 4th 2019, 21:42 |
phantomwatson |
You're asking how you validate your entity? |
# |
Jan 4th 2019, 21:42 |
ricksaccous |
oh |
# |
Jan 4th 2019, 21:41 |
ricksaccous |
is that what you meant? |
# |
Jan 4th 2019, 21:41 |
ricksaccous |
on entity |
# |
Jan 4th 2019, 21:41 |
ricksaccous |
i mean |
# |
Jan 4th 2019, 21:41 |
ricksaccous |
checking for errors within validation |
# |
Jan 4th 2019, 21:41 |
phantomwatson |
How do you prevent execution from being stopped? |
# |
Jan 4th 2019, 21:40 |
ricksaccous |
how do i get around that, lell |
# |
Jan 4th 2019, 21:40 |
ricksaccous |
yeah i figured |
# |
Jan 4th 2019, 21:40 |
phantomwatson |
If the parent model's first validation rule is for child data and it's marked last, then on the condition that that rule is violated, no subsequent validation checks should take place for that entity. |
# |
Jan 4th 2019, 21:39 |
ricksaccous |
about array conversions |
# |
Jan 4th 2019, 21:39 |
ricksaccous |
before the main validator but i got some weird error |
# |
Jan 4th 2019, 21:39 |
ricksaccous |
$validator = $this->RelatedModel->validationSomething($validator) |
# |
Jan 4th 2019, 21:39 |
ricksaccous |
and I tried $this->RelatedModel->validationSomething($validator) |
# |
Jan 4th 2019, 21:38 |
phantomwatson |
Validation rules should run in the same order as the code. |
# |
Jan 4th 2019, 21:38 |
ricksaccous |
SomeMethod* |
# |
Jan 4th 2019, 21:38 |
ricksaccous |
i have validationSomeMethod in Magicians model and validationSomeModel in Tricks model |
# |
Jan 4th 2019, 21:38 |
phantomwatson |
Did you place the child validation rule first? |
# |
Jan 4th 2019, 21:37 |
ricksaccous |
last only affects within that validator i think |
# |
Jan 4th 2019, 21:37 |
ricksaccous |
parent model rules still ran first |
# |
Jan 4th 2019, 21:37 |
phantomwatson |
What were the results? |
# |
Jan 4th 2019, 21:36 |
ricksaccous |
i've tried that |
# |
Jan 4th 2019, 21:35 |
phantomwatson |
You may be able to rig up a validation rule for the Magicians model that validates the `tricks` field and is marked `'last' => true`. That way, the Tricks validation error shows and not any subsequent validation errors on the Magicians model. |
# |
Jan 4th 2019, 21:34 |
ricksaccous |
i'm giong to try something |
# |
Jan 4th 2019, 21:34 |
ricksaccous |
hmmmm |
# |
Jan 4th 2019, 21:33 |
ricksaccous |
that's pretty much it actually, lol |
# |
Jan 4th 2019, 21:33 |
ricksaccous |
because no fields are integers the Magicians has no tricks error displays and not the integer validation on Tricks |
# |
Jan 4th 2019, 21:32 |
ricksaccous |
Tricks has a validation rule on a field where i need it to be an integer |
# |
Jan 4th 2019, 21:32 |
ricksaccous |
Magicians has a validation rule where if there are no Tricks display an error |
# |
Jan 4th 2019, 21:31 |
ricksaccous |
Magicians hasMany Tricks |
# |
Jan 4th 2019, 21:31 |
ricksaccous |
i actually can't because im validating a single Model but I want child data of it to be validated first, for example |