plugin/tag/Serializer/TagSerializer.php
public function serialize(Tag $tag, array $options = []): array
    {
        $serialized = [
            'id' => $tag->getUuid(),
            'name' => $tag->getName(),
            'color' => $tag->getColor(),
        ];

        if (!in_array(Options::SERIALIZE_MINIMAL, $options)) {
            $serialized = array_merge($serialized, [
                'meta' => [
                    'description' => $tag->getDescription(),
                    'creator' => $tag->getUser() ?
                        $this->userSerializer->serialize($tag->getUser(), [Options::SERIALIZE_MINIMAL]) :
                        null,
                ],
                'elements' => $this->taggedObjectRepo->countByTag($tag),
            ]);
        }

        return $serialized;
    }
public function serialize(Tag $tag, array $options = []): array
    {
        $serialized = [
            'id' => $tag->getUuid(),
            'name' => $tag->getName(),
            'color' => $tag->getColor(),
        ];

        if (!in_array(Options::SERIALIZE_MINIMAL, $options)) {
            $serialized = array_merge($serialized, [
                'meta' => [
                    'description' => $tag->getDescription(),
                    'creator' => $tag->getUser() ?
                        $this->userSerializer->serialize($tag->getUser(), [Options::SERIALIZE_MINIMAL]) :
                        null,
                ],
                'elements' => $this->taggedObjectRepo->countByTag($tag),
            ]);
        }

        return $serialized;
    }
public function serialize ( Tag $ tag , array $ options = [ ] ) : array { $ serialized = [ 'id' => $ tag -> getUuid ( ) , 'name' => $ tag -> getName ( ) , 'color' => $ tag -> getColor ( ) , ] ; if ( ! in_array ( Options :: SERIALIZE_MINIMAL , $ options ) ) { $ serialized = array_merge ( $ serialized , [ 'meta' => [ 'description' => $ tag -> getDescription ( ) , 'creator' => $ tag -> getUser ( ) ? $ this -> userSerializer -> serialize ( $ tag -> getUser ( ) , [ Options :: SERIALIZE_MINIMAL ] ) : null , ] , 'elements' => $ this -> taggedObjectRepo -> countByTag ( $ tag ) , ] ) ; } return $ serialized ; }
Serializes a Tag entity into a serializable array.

@param Tag   $tag
@param array $options

@return array
Serializes a Tag entity into a serializable array .