base\Model loadMultiple()

loadMultiple() public static method

Populates a set of models with the data from end user.

This method is mainly used to collect tabular data input. The data to be loaded for each model is $data[formName][index], where formName refers to the value of formName(), and index the index of the model in the $models array. If formName() is empty, $data[index] will be used to populate each model. The data being populated to each model is subject to the safety check by setAttributes().

public static boolean loadMultiple ( $models, $data, $formName = null )
$models array

The models to be populated. Note that all models should have the same class.

$data array

The data array. This is usually $_POST or $_GET, but can also be any valid array supplied by end user.

$formName string

The form name to be used for loading the data into the models. If not set, it will use the formName() value of the first model in $models. This parameter is available since version 2.0.1.

return boolean

Whether at least one of the models is successfully populated.

doc_Yii
2016-10-30 16:51:53
Comments
Leave a Comment

Please login to continue.