src/Fractal.php
public function data($dataType, $data, $transformer = null)
    {
        $this->dataType = $dataType;

        $this->data = $data;

        if (! is_null($transformer)) {
            $this->transformer = $transformer;
        }

        return $this;
    }
public function data($dataType, $data, $transformer = null)
    {
        $this->dataType = $dataType;

        $this->data = $data;

        if (! is_null($transformer)) {
            $this->transformer = $transformer;
        }

        return $this;
    }
public function data ( $ dataType , $ data , $ transformer = null ) { $ this -> dataType = $ dataType ; $ this -> data = $ data ; if ( ! is_null ( $ transformer ) ) { $ this -> transformer = $ transformer ; } return $ this ; }
Set the data that must be transformed.

@param string $dataType
@param mixed $data
@param null|string|callable|\League\Fractal\TransformerAbstract $transformer

@return $this
Set the data that must be transformed .