public function serialize(Theme $theme)
    {
        return [
            'id' => $theme->getUuid(),
            'name' => $theme->getName(),
            'normalizedName' => str_replace(' ', '-', strtolower($theme->getName())),
            'current' => $theme->getNormalizedName() === str_replace(' ', '-', strtolower($this->config->getParameter('theme'))),
            'meta' => [
                'description' => $theme->getDescription(),
                'default' => $theme->isDefault(),
                'enabled' => $theme->isEnabled(),
                'custom' => $theme->isCustom(),
                'plugin' => $theme->getPlugin() ? $theme->getPlugin()->getShortName() : null,
                'creator' => $theme->getUser() ? $this->userSerializer->serialize($theme->getUser()) : null,
            ],
            'parameters' => [
                'extendDefault' => $theme->isExtendingDefault(),
            ],
        ];
    }
public function serialize(Theme $theme)
    {
        return [
            'id' => $theme->getUuid(),
            'name' => $theme->getName(),
            'normalizedName' => str_replace(' ', '-', strtolower($theme->getName())),
            'current' => $theme->getNormalizedName() === str_replace(' ', '-', strtolower($this->config->getParameter('theme'))),
            'meta' => [
                'description' => $theme->getDescription(),
                'default' => $theme->isDefault(),
                'enabled' => $theme->isEnabled(),
                'custom' => $theme->isCustom(),
                'plugin' => $theme->getPlugin() ? $theme->getPlugin()->getShortName() : null,
                'creator' => $theme->getUser() ? $this->userSerializer->serialize($theme->getUser()) : null,
            ],
            'parameters' => [
                'extendDefault' => $theme->isExtendingDefault(),
            ],
        ];
    }
public function serialize ( Theme $ theme ) { return [ 'id' => $ theme -> getUuid ( ) , 'name' => $ theme -> getName ( ) , 'normalizedName' => str_replace ( ' ' , '-' , strtolower ( $ theme -> getName ( ) ) ) , 'current' => $ theme -> getNormalizedName ( ) === str_replace ( ' ' , '-' , strtolower ( $ this -> config -> getParameter ( 'theme' ) ) ) , 'meta' => [ 'description' => $ theme -> getDescription ( ) , 'default' => $ theme -> isDefault ( ) , 'enabled' => $ theme -> isEnabled ( ) , 'custom' => $ theme -> isCustom ( ) , 'plugin' => $ theme -> getPlugin ( ) ? $ theme -> getPlugin ( ) -> getShortName ( ) : null , 'creator' => $ theme -> getUser ( ) ? $ this -> userSerializer -> serialize ( $ theme -> getUser ( ) ) : null , ] , 'parameters' => [ 'extendDefault' => $ theme -> isExtendingDefault ( ) , ] , ] ; }
Serializes a Theme entity for the JSON api.

@param Theme $theme - the theme to serialize

@return array - the serialized representation of the theme
Serializes a Theme entity for the JSON api .