public function deserialize($data, MatchQuestion $setQuestion = null, array $options = [])
    {
        if (empty($setQuestion)) {
            $setQuestion = new MatchQuestion();
        }

        if (!empty($data['penalty']) || 0 === $data['penalty']) {
            $setQuestion->setPenalty($data['penalty']);
        }

        $this->sipe('random', 'setShuffle', $data, $setQuestion);

        // deserialize proposals labels and solutions
        $this->deserializeLabels($setQuestion, $data['sets']);
        $this->deserializeProposals($setQuestion, $data['items']);
        $this->deserializeSolutions($setQuestion, array_merge($data['solutions']['associations'], $data['solutions']['odd']));

        return $setQuestion;
    }
public function deserialize($data, MatchQuestion $setQuestion = null, array $options = [])
    {
        if (empty($setQuestion)) {
            $setQuestion = new MatchQuestion();
        }

        if (!empty($data['penalty']) || 0 === $data['penalty']) {
            $setQuestion->setPenalty($data['penalty']);
        }

        $this->sipe('random', 'setShuffle', $data, $setQuestion);

        // deserialize proposals labels and solutions
        $this->deserializeLabels($setQuestion, $data['sets']);
        $this->deserializeProposals($setQuestion, $data['items']);
        $this->deserializeSolutions($setQuestion, array_merge($data['solutions']['associations'], $data['solutions']['odd']));

        return $setQuestion;
    }
public function deserialize ( $ data , MatchQuestion $ setQuestion = null , array $ options = [ ] ) { if ( empty ( $ setQuestion ) ) { $ setQuestion = new MatchQuestion ( ) ; } if ( ! empty ( $ data [ 'penalty' ] ) || 0 === $ data [ 'penalty' ] ) { $ setQuestion -> setPenalty ( $ data [ 'penalty' ] ) ; } $ this -> sipe ( 'random' , 'setShuffle' , $ data , $ setQuestion ) ; // deserialize proposals labels and solutions $ this -> deserializeLabels ( $ setQuestion , $ data [ 'sets' ] ) ; $ this -> deserializeProposals ( $ setQuestion , $ data [ 'items' ] ) ; $ this -> deserializeSolutions ( $ setQuestion , array_merge ( $ data [ 'solutions' ] [ 'associations' ] , $ data [ 'solutions' ] [ 'odd' ] ) ) ; return $ setQuestion ; }
Converts raw data into a Set question entity.

@param array         $data
@param MatchQuestion $setQuestion
@param array         $options

@return MatchQuestion
Converts raw data into a Set question entity .