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;
    }
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;
    }
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 ; }
Updates an existing theme.

@param Theme $theme
@param array $data

@return Theme

@throws InvalidDataException
Updates an existing theme .