public function deserialize($data, ResourceNode $resourceNode = null, array $options = [])
    {
        if (empty($resourceNode)) {
            $id = method_exists($data, 'getId') ? $data->getId() : $data['id'];
            $resourceNode = $this->om->getRepository('ClarolineCoreBundle:Resource\ResourceNode')->find($id);
        }

        return $resourceNode;
    }
public function deserialize($data, ResourceNode $resourceNode = null, array $options = [])
    {
        if (empty($resourceNode)) {
            $id = method_exists($data, 'getId') ? $data->getId() : $data['id'];
            $resourceNode = $this->om->getRepository('ClarolineCoreBundle:Resource\ResourceNode')->find($id);
        }

        return $resourceNode;
    }
public function deserialize ( $ data , ResourceNode $ resourceNode = null , array $ options = [ ] ) { if ( empty ( $ resourceNode ) ) { $ id = method_exists ( $ data , 'getId' ) ? $ data -> getId ( ) : $ data [ 'id' ] ; $ resourceNode = $ this -> om -> getRepository ( 'ClarolineCoreBundle:Resource\ResourceNode' ) -> find ( $ id ) ; } return $ resourceNode ; }
Converts raw data into a ResourceNode.

The only purpose of this serializer is to expose a common data representation of a resource,
it's not made to create/update them so the deserialization only returns an existing ResourceNode

@param array        $data
@param ResourceNode $resourceNode
@param array        $options

@return mixed
Converts raw data into a ResourceNode .