public function update(Theme $theme, array $data)
    {
        $errors = $this->validate($data);
        if (count($errors) > 0) {
            throw new InvalidDataException('Theme is not valid', $errors);
        }

        $this->serializer->deserialize($data, $theme);

        // todo : create directory structure and files
        // todo : move files if name change

        $this->om->persist($theme);
        $this->om->flush();

        return $theme;
    }