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

        if (!empty($data['penalty']) || 0 === $data['penalty']) {
            $pairQuestion->setPenalty($data['penalty']);
        }
        $this->sipe('random', 'setShuffle', $data, $pairQuestion);

        $this->deserializeItems($pairQuestion, $data['items'], $options);
        $this->deserializeSolutions($pairQuestion, $data['solutions']);

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

        if (!empty($data['penalty']) || 0 === $data['penalty']) {
            $pairQuestion->setPenalty($data['penalty']);
        }
        $this->sipe('random', 'setShuffle', $data, $pairQuestion);

        $this->deserializeItems($pairQuestion, $data['items'], $options);
        $this->deserializeSolutions($pairQuestion, $data['solutions']);

        return $pairQuestion;
    }
public function deserialize ( $ data , PairQuestion $ pairQuestion = null , array $ options = [ ] ) { if ( empty ( $ pairQuestion ) ) { $ pairQuestion = new PairQuestion ( ) ; } if ( ! empty ( $ data [ 'penalty' ] ) || 0 === $ data [ 'penalty' ] ) { $ pairQuestion -> setPenalty ( $ data [ 'penalty' ] ) ; } $ this -> sipe ( 'random' , 'setShuffle' , $ data , $ pairQuestion ) ; $ this -> deserializeItems ( $ pairQuestion , $ data [ 'items' ] , $ options ) ; $ this -> deserializeSolutions ( $ pairQuestion , $ data [ 'solutions' ] ) ; return $ pairQuestion ; }
Converts raw data into a Pair question entity.

@param array        $data
@param PairQuestion $pairQuestion
@param array        $options

@return PairQuestion
Converts raw data into a Pair question entity .