When you want to set value to your model attributes, please know which to use.
From the API documentation,
load() public method
Populates the model with input data.
You might want to use this when the value are passed by a form with input fields.
setAttributes() public method
Sets the attribute values in a massive way.
You might want to use this when the values are not passed by a form.
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.