public function transform($data, $transformer = null, $resourceKey = null, PaginatorInterface $adapter = null)
    {
        if (!$transformer) {
            $transformer = $this->getTransformer();
        }

        $fractal = $this->getService();

        if ($this->isCollection($data)) {
            return $fractal->collection($data, $transformer, $resourceKey, $adapter);
        }

        return $fractal->item($data, $transformer, $resourceKey);
    }