-
-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LoadMultipleTrait #214
LoadMultipleTrait #214
Conversation
Related: yiisoft/yii2#19284 |
What's a use case for these methods? |
Loading tabular data |
if ($model->load($data[$i], '') === true) { | ||
$this->models[] = $model; | ||
} else { | ||
$this->models[] = $success = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use several types (false or FormModel) in array of models is confused.
{ | ||
use TestTrait; | ||
|
||
/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test need for success case.
Closed in favor yiisoft/form-model#11 |
Trait to be used in Form models.
Adds two methods:
loadMultiple() to load multiple models
getModels() to get the loaded models
#Usage
In an action