src/TransformerAbstract.php
protected function callIncludeMethod(Scope $scope, $includeName, $data)
    {
        $scopeIdentifier = $scope->getIdentifier($includeName);
        $params = $scope->getManager()->getIncludeParams($scopeIdentifier);

        // Check if the method name actually exists
        $methodName = 'include'.str_replace(' ', '', ucwords(str_replace('_', ' ', str_replace('-', ' ', $includeName))));

        $resource = call_user_func([$this, $methodName], $data, $params);

        if ($resource === null) {
            return false;
        }

        if (! $resource instanceof ResourceInterface) {
            throw new \Exception(sprintf(
                'Invalid return value from %s::%s(). Expected %s, received %s.',
                __CLASS__,
                $methodName,
                'League\Fractal\Resource\ResourceInterface',
                is_object($resource) ? get_class($resource) : gettype($resource)
            ));
        }

        return $resource;
    }
protected function callIncludeMethod(Scope $scope, $includeName, $data)
    {
        $scopeIdentifier = $scope->getIdentifier($includeName);
        $params = $scope->getManager()->getIncludeParams($scopeIdentifier);

        // Check if the method name actually exists
        $methodName = 'include'.str_replace(' ', '', ucwords(str_replace('_', ' ', str_replace('-', ' ', $includeName))));

        $resource = call_user_func([$this, $methodName], $data, $params);

        if ($resource === null) {
            return false;
        }

        if (! $resource instanceof ResourceInterface) {
            throw new \Exception(sprintf(
                'Invalid return value from %s::%s(). Expected %s, received %s.',
                __CLASS__,
                $methodName,
                'League\Fractal\Resource\ResourceInterface',
                is_object($resource) ? get_class($resource) : gettype($resource)
            ));
        }

        return $resource;
    }
protected function callIncludeMethod ( Scope $ scope , $ includeName , $ data ) { $ scopeIdentifier = $ scope -> getIdentifier ( $ includeName ) ; $ params = $ scope -> getManager ( ) -> getIncludeParams ( $ scopeIdentifier ) ; // Check if the method name actually exists $ methodName = 'include' . str_replace ( ' ' , '' , ucwords ( str_replace ( '_' , ' ' , str_replace ( '-' , ' ' , $ includeName ) ) ) ) ; $ resource = call_user_func ( [ $ this , $ methodName ] , $ data , $ params ) ; if ( $ resource === null ) { return false ; } if ( ! $ resource instanceof ResourceInterface ) { throw new \ Exception ( sprintf ( 'Invalid return value from %s::%s(). Expected %s, received %s.' , __CLASS__ , $ methodName , 'League\Fractal\Resource\ResourceInterface' , is_object ( $ resource ) ? get_class ( $ resource ) : gettype ( $ resource ) ) ) ; } return $ resource ; }
Call Include Method.

@internal

@param Scope  $scope
@param string $includeName
@param mixed  $data

@throws \Exception

@return \League\Fractal\Resource\ResourceInterface
Call Include Method .