protected function serialize($data, $group = self::SERIALIZE_FULL)
    {
        return $this->get('serializer')->serialize($data, 'json', ['groups' => [$group]]);
    }
protected function serialize($data, $group = self::SERIALIZE_FULL)
    {
        return $this->get('serializer')->serialize($data, 'json', ['groups' => [$group]]);
    }
protected function serialize ( $ data , $ group = self :: SERIALIZE_FULL ) { return $ this -> get ( 'serializer' ) -> serialize ( $ data , 'json' , [ 'groups' => [ $ group ] ] ) ; }
Serializes the data.

@param array  $data
@param string $group

@return mixed|string
Serializes the data .