src/Serializer/JsonApiSerializer.php
private function createRootObjects($data)
    {
        if ($this->isCollection($data)) {
            $this->setRootObjects($data['data']);
        } else {
            $this->setRootObjects([$data['data']]);
        }
    }
private function createRootObjects($data)
    {
        if ($this->isCollection($data)) {
            $this->setRootObjects($data['data']);
        } else {
            $this->setRootObjects([$data['data']]);
        }
    }
private function createRootObjects ( $ data ) { if ( $ this -> isCollection ( $ data ) ) { $ this -> setRootObjects ( $ data [ 'data' ] ) ; } else { $ this -> setRootObjects ( [ $ data [ 'data' ] ] ) ; } }
Sets the RootObjects, either as collection or not.

@param $data
Sets the RootObjects either as collection or not .