Documents: Massive Jobs
As with regular models, Active Record instances also have a large assignment function. With this function, you can assign values ββto multiple attributes of an Active Record instance in a single PHP expression, as shown below. Remember that only safe attributes can be assigned in bulk.
Documents: Safe Attributes
For this reason, a special alias safe validator is provided so that you can declare an attribute safe without actually validating it. For example, the following rules declare that both headings and descriptions are safe attributes.
You should do some checking on your attribute, if you do not have any validation requirements - define it as safe .
public function rules() { return [ [['name'], 'safe'], ]; }
source share