plugin/exo/Manager/Item/ItemManager.php
public function update(Item $question, array $data)
    {
        // Validate received data
        $errors = $this->validator->validate($data, [Validation::REQUIRE_SOLUTIONS]);
        if (count($errors) > 0) {
            throw new InvalidDataException('Question is not valid', $errors);
        }

        // Update Item with new data
        $this->serializer->deserialize($data, $question, [Transfer::PERSIST_TAG]);

        // Save to DB
        $this->om->persist($question);
        $this->om->flush();

        return $question;
    }
public function update(Item $question, array $data)
    {
        // Validate received data
        $errors = $this->validator->validate($data, [Validation::REQUIRE_SOLUTIONS]);
        if (count($errors) > 0) {
            throw new InvalidDataException('Question is not valid', $errors);
        }

        // Update Item with new data
        $this->serializer->deserialize($data, $question, [Transfer::PERSIST_TAG]);

        // Save to DB
        $this->om->persist($question);
        $this->om->flush();

        return $question;
    }
public function update ( Item $ question , array $ data ) { // Validate received data $ errors = $ this -> validator -> validate ( $ data , [ Validation :: REQUIRE_SOLUTIONS ] ) ; if ( count ( $ errors ) > 0 ) { throw new InvalidDataException ( 'Question is not valid' , $ errors ) ; } // Update Item with new data $ this -> serializer -> deserialize ( $ data , $ question , [ Transfer :: PERSIST_TAG ] ) ; // Save to DB $ this -> om -> persist ( $ question ) ; $ this -> om -> flush ( ) ; return $ question ; }
Validates and updates a Item entity with raw data.

@param Item  $question
@param array $data

@return Item

@throws InvalidDataException
Validates and updates a Item entity with raw data .