public static function loadRelation(ActiveRecord $model, $relationName, $data, $requiredData = [])
    {
        $relationClass = $model->getRelation($relationName)->modelClass;
        return static::loadMultiple(
            @$data[(new $relationClass())->formName()],
            $relationClass,
            $model->$relationName,
            $requiredData
        );
    }
public static function loadRelation(ActiveRecord $model, $relationName, $data, $requiredData = [])
    {
        $relationClass = $model->getRelation($relationName)->modelClass;
        return static::loadMultiple(
            @$data[(new $relationClass())->formName()],
            $relationClass,
            $model->$relationName,
            $requiredData
        );
    }
public static function loadRelation ( ActiveRecord $ model , $ relationName , $ data , $ requiredData = [ ] ) { $ relationClass = $ model -> getRelation ( $ relationName ) -> modelClass ; return static :: loadMultiple ( @ $ data [ ( new $ relationClass ( ) ) -> formName ( ) ] , $ relationClass , $ model -> $ relationName , $ requiredData ) ; }
Loads posted data into model relation models
@param ActiveRecord $model
@param $relationName
@param $data
@param array $requiredData
@return array
Loads posted data into model relation models