src/Core/Model.php
protected static function formItems($provider, $array)
    {
        $set = [];

        foreach ($array['items'] as $params) {
            $instance = new static($provider, array_merge($params, ['exists' => true]));
            $instance->cacheFields($params);
            if (isset($instance->id)) {
                $set[$instance->id] = $instance;
            } else {
                $set[] = $instance;
            }
        }

        return $set;
    }
protected static function formItems($provider, $array)
    {
        $set = [];

        foreach ($array['items'] as $params) {
            $instance = new static($provider, array_merge($params, ['exists' => true]));
            $instance->cacheFields($params);
            if (isset($instance->id)) {
                $set[$instance->id] = $instance;
            } else {
                $set[] = $instance;
            }
        }

        return $set;
    }
protected static function formItems ( $ provider , $ array ) { $ set = [ ] ; foreach ( $ array [ 'items' ] as $ params ) { $ instance = new static ( $ provider , array_merge ( $ params , [ 'exists' => true ] ) ) ; $ instance -> cacheFields ( $ params ) ; if ( isset ( $ instance -> id ) ) { $ set [ $ instance -> id ] = $ instance ; } else { $ set [ ] = $ instance ; } } return $ set ; }
Unwrap the instances from response
@param $provider
@param $array
@return array
@throws \ReflectionException
Unwrap the instances from response