public function collection($data, TransformerInterface $transformer = null, $key = null, callable $callback = null)
    {
        $this->setResource(new Collection($data, $transformer, $key));
        if ($callback !== null) {
            $callback($this->resource);
        }

        return $this;
    }
public function collection($data, TransformerInterface $transformer = null, $key = null, callable $callback = null)
    {
        $this->setResource(new Collection($data, $transformer, $key));
        if ($callback !== null) {
            $callback($this->resource);
        }

        return $this;
    }
public function collection ( $ data , TransformerInterface $ transformer = null , $ key = null , callable $ callback = null ) { $ this -> setResource ( new Collection ( $ data , $ transformer , $ key ) ) ; if ( $ callback !== null ) { $ callback ( $ this -> resource ) ; } return $ this ; }
Set the resource collection to be transformed.

@param mixed                           $data
@param TransformerInterface|mixed|null $transformer
@param string|null                     $key
@param callable|null                   $callback

@throws \Rexlabs\Smokescreen\Exception\InvalidTransformerException

@return $this
Set the resource collection to be transformed .