plugin/exo/Serializer/Attempt/PaperSerializer.php
public function deserialize($data, Paper $paper = null, array $options = [])
    {
        $paper = $paper ?: new Paper();

        $this->sipe('id', 'setUuid', $data, $paper);
        $this->sipe('number', 'setNumber', $data, $paper);
        $this->sipe('score', 'setScore', $data, $paper);

        if (isset($data['startDate'])) {
            $startDate = DateNormalizer::denormalize($data['startDate']);
            $paper->setStart($startDate);
        }
        if (isset($data['endDate'])) {
            $endDate = DateNormalizer::denormalize($data['endDate']);
            $paper->setEnd($endDate);
        }
        if (isset($data['structure'])) {
            $paper->setStructure(json_encode($data['structure']));
        }
        if (isset($data['finished'])) {
            $paper->setInterrupted(!$data['finished']);
        }
        if (isset($data['answers'])) {
            $this->deserializeAnswers($paper, $data['answers'], $options);
        }

        return $paper;
    }
public function deserialize($data, Paper $paper = null, array $options = [])
    {
        $paper = $paper ?: new Paper();

        $this->sipe('id', 'setUuid', $data, $paper);
        $this->sipe('number', 'setNumber', $data, $paper);
        $this->sipe('score', 'setScore', $data, $paper);

        if (isset($data['startDate'])) {
            $startDate = DateNormalizer::denormalize($data['startDate']);
            $paper->setStart($startDate);
        }
        if (isset($data['endDate'])) {
            $endDate = DateNormalizer::denormalize($data['endDate']);
            $paper->setEnd($endDate);
        }
        if (isset($data['structure'])) {
            $paper->setStructure(json_encode($data['structure']));
        }
        if (isset($data['finished'])) {
            $paper->setInterrupted(!$data['finished']);
        }
        if (isset($data['answers'])) {
            $this->deserializeAnswers($paper, $data['answers'], $options);
        }

        return $paper;
    }
public function deserialize ( $ data , Paper $ paper = null , array $ options = [ ] ) { $ paper = $ paper ? : new Paper ( ) ; $ this -> sipe ( 'id' , 'setUuid' , $ data , $ paper ) ; $ this -> sipe ( 'number' , 'setNumber' , $ data , $ paper ) ; $ this -> sipe ( 'score' , 'setScore' , $ data , $ paper ) ; if ( isset ( $ data [ 'startDate' ] ) ) { $ startDate = DateNormalizer :: denormalize ( $ data [ 'startDate' ] ) ; $ paper -> setStart ( $ startDate ) ; } if ( isset ( $ data [ 'endDate' ] ) ) { $ endDate = DateNormalizer :: denormalize ( $ data [ 'endDate' ] ) ; $ paper -> setEnd ( $ endDate ) ; } if ( isset ( $ data [ 'structure' ] ) ) { $ paper -> setStructure ( json_encode ( $ data [ 'structure' ] ) ) ; } if ( isset ( $ data [ 'finished' ] ) ) { $ paper -> setInterrupted ( ! $ data [ 'finished' ] ) ; } if ( isset ( $ data [ 'answers' ] ) ) { $ this -> deserializeAnswers ( $ paper , $ data [ 'answers' ] , $ options ) ; } return $ paper ; }
Converts raw data into a Paper entity.

@param array $data
@param Paper $paper
@param array $options

@return Paper
Converts raw data into a Paper entity .