public function deserialize(array $data, FieldFacetValue $fieldFacetValue = null, array $options = [])
    {
        $fieldFacet = $this->container->get('claroline.persistence.object_manager')
            ->getRepository(FieldFacet::class)
            ->findOneByUuid($data['fieldFacet']['id']);

        $fieldFacetValue->setFieldFacet($fieldFacet);
        $value = $data['value'];

        switch ($fieldFacet->getType()) {
            case FieldFacet::DATE_TYPE:
                $date = is_string($value) ?
                    new \DateTime($value) :
                    $value;
                $fieldFacetValue->setDateValue($date);
                break;
            case FieldFacet::NUMBER_TYPE:
                $fieldFacetValue->setFloatValue($value);
                break;
            case FieldFacet::CASCADE_TYPE:
                $fieldFacetValue->setArrayValue($value);
                break;
            case FieldFacet::CHOICE_TYPE:
                if (is_array($value)) {
                    $fieldFacetValue->setArrayValue($value);
                } else {
                    $fieldFacetValue->setStringValue($value);
                }
                break;
            case FieldFacet::BOOLEAN_TYPE:
                $fieldFacetValue->setBoolValue($value);
                break;
            default:
                $fieldFacetValue->setStringValue($value);
        }

        return $fieldFacetValue;
    }