public function serialize(FieldFacetValue $fieldFacetValue, array $options = [])
    {
        //this is the bloc that should be used
        if (in_array(Options::PROFILE_SERIALIZE, $options)) {
        }

        //probably used by the clacoform
        $serialized = [
            'id' => $fieldFacetValue->getId(),
            'value' => $fieldFacetValue->getValue(),
            'name' => $fieldFacetValue->getFieldFacet()->getName(),
        ];

        if (!in_array(static::OPTION_MINIMAL, $options)) {
            $serialized = array_merge($serialized, [
                'user' => $fieldFacetValue->getUser() ? [
                  'autoId' => $fieldFacetValue->getUser()->getId(), //for old compatibility purposes
                  'id' => $fieldFacetValue->getUser()->getUuid(),
                  'name' => $fieldFacetValue->getUser()->getFirstName().' '.$fieldFacetValue->getUser()->getLastName(),
                  'firstName' => $fieldFacetValue->getUser()->getFirstName(),
                  'lastName' => $fieldFacetValue->getUser()->getLastName(),
                  'username' => $fieldFacetValue->getUser()->getUsername(),
                  'email' => $fieldFacetValue->getUser()->getEmail(),
                  ] : null,
                'fieldFacet' => $this->fieldFacetSerializer->serialize($fieldFacetValue->getFieldFacet()),
            ]);
        }

        return $serialized;
    }
public function serialize(FieldFacetValue $fieldFacetValue, array $options = [])
    {
        //this is the bloc that should be used
        if (in_array(Options::PROFILE_SERIALIZE, $options)) {
        }

        //probably used by the clacoform
        $serialized = [
            'id' => $fieldFacetValue->getId(),
            'value' => $fieldFacetValue->getValue(),
            'name' => $fieldFacetValue->getFieldFacet()->getName(),
        ];

        if (!in_array(static::OPTION_MINIMAL, $options)) {
            $serialized = array_merge($serialized, [
                'user' => $fieldFacetValue->getUser() ? [
                  'autoId' => $fieldFacetValue->getUser()->getId(), //for old compatibility purposes
                  'id' => $fieldFacetValue->getUser()->getUuid(),
                  'name' => $fieldFacetValue->getUser()->getFirstName().' '.$fieldFacetValue->getUser()->getLastName(),
                  'firstName' => $fieldFacetValue->getUser()->getFirstName(),
                  'lastName' => $fieldFacetValue->getUser()->getLastName(),
                  'username' => $fieldFacetValue->getUser()->getUsername(),
                  'email' => $fieldFacetValue->getUser()->getEmail(),
                  ] : null,
                'fieldFacet' => $this->fieldFacetSerializer->serialize($fieldFacetValue->getFieldFacet()),
            ]);
        }

        return $serialized;
    }
public function serialize ( FieldFacetValue $ fieldFacetValue , array $ options = [ ] ) { //this is the bloc that should be used if ( in_array ( Options :: PROFILE_SERIALIZE , $ options ) ) { } //probably used by the clacoform $ serialized = [ 'id' => $ fieldFacetValue -> getId ( ) , 'value' => $ fieldFacetValue -> getValue ( ) , 'name' => $ fieldFacetValue -> getFieldFacet ( ) -> getName ( ) , ] ; if ( ! in_array ( static :: OPTION_MINIMAL , $ options ) ) { $ serialized = array_merge ( $ serialized , [ 'user' => $ fieldFacetValue -> getUser ( ) ? [ 'autoId' => $ fieldFacetValue -> getUser ( ) -> getId ( ) , //for old compatibility purposes 'id' => $ fieldFacetValue -> getUser ( ) -> getUuid ( ) , 'name' => $ fieldFacetValue -> getUser ( ) -> getFirstName ( ) . ' ' . $ fieldFacetValue -> getUser ( ) -> getLastName ( ) , 'firstName' => $ fieldFacetValue -> getUser ( ) -> getFirstName ( ) , 'lastName' => $ fieldFacetValue -> getUser ( ) -> getLastName ( ) , 'username' => $ fieldFacetValue -> getUser ( ) -> getUsername ( ) , 'email' => $ fieldFacetValue -> getUser ( ) -> getEmail ( ) , ] : null , 'fieldFacet' => $ this -> fieldFacetSerializer -> serialize ( $ fieldFacetValue -> getFieldFacet ( ) ) , ] ) ; } return $ serialized ; }
Serializes a FieldFacetValue entity for the JSON api.

@param FieldFacetValue $fieldFacetValue - the field facet value to serialize
@param array           $options         - a list of serialization options

@return array - the serialized representation of the field facet value
Serializes a FieldFacetValue entity for the JSON api .