protected function resolveModelSource(Model $model, $source)
    {
        // If the strategy indicates a method to be called on the model itself, do so
        if ($method = $this->parseAsModelMethodStrategyString($source, $model)) {
            return $model->{$method}();
        }

        // If the strategy indicates an instantiable/callable 'class@method' combination
        if ($data = $this->parseAsInstantiableClassMethodStrategyString($source)) {

            $method   = $data['method'];
            $instance = $data['instance'];

            return $instance->{$method}($model);
        }

        // If the name matches a method name on the model, call it
        if (method_exists($model, $source)) {
            return $model->{$source}();
        }

        return $model->{$source};
    }
protected function resolveModelSource(Model $model, $source)
    {
        // If the strategy indicates a method to be called on the model itself, do so
        if ($method = $this->parseAsModelMethodStrategyString($source, $model)) {
            return $model->{$method}();
        }

        // If the strategy indicates an instantiable/callable 'class@method' combination
        if ($data = $this->parseAsInstantiableClassMethodStrategyString($source)) {

            $method   = $data['method'];
            $instance = $data['instance'];

            return $instance->{$method}($model);
        }

        // If the name matches a method name on the model, call it
        if (method_exists($model, $source)) {
            return $model->{$source}();
        }

        return $model->{$source};
    }
protected function resolveModelSource ( Model $ model , $ source ) { // If the strategy indicates a method to be called on the model itself, do so if ( $ method = $ this -> parseAsModelMethodStrategyString ( $ source , $ model ) ) { return $ model -> { $ method } ( ) ; } // If the strategy indicates an instantiable/callable 'class@method' combination if ( $ data = $ this -> parseAsInstantiableClassMethodStrategyString ( $ source ) ) { $ method = $ data [ 'method' ] ; $ instance = $ data [ 'instance' ] ; return $ instance -> { $ method } ( $ model ) ; } // If the name matches a method name on the model, call it if ( method_exists ( $ model , $ source ) ) { return $ model -> { $ source } ( ) ; } return $ model -> { $ source } ; }
Resolves and returns source content for a list strategy.

@param Model  $model
@param string $source
@return mixed
Resolves and returns source content for a list strategy .