plugin/exo/Serializer/Item/Type/GridQuestionSerializer.php
public function deserialize($data, GridQuestion $gridQuestion = null, array $options = [])
    {
        if (empty($gridQuestion)) {
            $gridQuestion = new GridQuestion();
        }
        if (!empty($data['penalty']) || 0 === $data['penalty']) {
            $gridQuestion->setPenalty($data['penalty']);
        }
        $this->sipe('data', 'setData', $data, $gridQuestion);
        $this->sipe('rows', 'setRows', $data, $gridQuestion);
        $this->sipe('cols', 'setColumns', $data, $gridQuestion);
        $this->sipe('sumMode', 'setSumMode', $data, $gridQuestion);
        $this->sipe('border.width', 'setBorderWidth', $data, $gridQuestion);
        $this->sipe('border.color', 'setBorderColor', $data, $gridQuestion);

        // Deserialize cells and solutions
        $this->deserializeCells($gridQuestion, $data['cells'], $data['solutions'], $options);

        return $gridQuestion;
    }
public function deserialize($data, GridQuestion $gridQuestion = null, array $options = [])
    {
        if (empty($gridQuestion)) {
            $gridQuestion = new GridQuestion();
        }
        if (!empty($data['penalty']) || 0 === $data['penalty']) {
            $gridQuestion->setPenalty($data['penalty']);
        }
        $this->sipe('data', 'setData', $data, $gridQuestion);
        $this->sipe('rows', 'setRows', $data, $gridQuestion);
        $this->sipe('cols', 'setColumns', $data, $gridQuestion);
        $this->sipe('sumMode', 'setSumMode', $data, $gridQuestion);
        $this->sipe('border.width', 'setBorderWidth', $data, $gridQuestion);
        $this->sipe('border.color', 'setBorderColor', $data, $gridQuestion);

        // Deserialize cells and solutions
        $this->deserializeCells($gridQuestion, $data['cells'], $data['solutions'], $options);

        return $gridQuestion;
    }
public function deserialize ( $ data , GridQuestion $ gridQuestion = null , array $ options = [ ] ) { if ( empty ( $ gridQuestion ) ) { $ gridQuestion = new GridQuestion ( ) ; } if ( ! empty ( $ data [ 'penalty' ] ) || 0 === $ data [ 'penalty' ] ) { $ gridQuestion -> setPenalty ( $ data [ 'penalty' ] ) ; } $ this -> sipe ( 'data' , 'setData' , $ data , $ gridQuestion ) ; $ this -> sipe ( 'rows' , 'setRows' , $ data , $ gridQuestion ) ; $ this -> sipe ( 'cols' , 'setColumns' , $ data , $ gridQuestion ) ; $ this -> sipe ( 'sumMode' , 'setSumMode' , $ data , $ gridQuestion ) ; $ this -> sipe ( 'border.width' , 'setBorderWidth' , $ data , $ gridQuestion ) ; $ this -> sipe ( 'border.color' , 'setBorderColor' , $ data , $ gridQuestion ) ; // Deserialize cells and solutions $ this -> deserializeCells ( $ gridQuestion , $ data [ 'cells' ] , $ data [ 'solutions' ] , $ options ) ; return $ gridQuestion ; }
Converts raw data into a Grid question entity.

@param array        $data
@param GridQuestion $gridQuestion
@param array        $options

@return GridQuestion
Converts raw data into a Grid question entity .