<?php
namespace zin;

class thinkModel extends wg
{
    /**
     * @var mixed[]
     */
    protected static $defineProps = array(
        'mode?: string', // 模型展示模式。 preview 后台设计预览 | view 前台结果展示
        'blocks: array'  // 模型节点
    );

    /**
     * @return \zin\wg|mixed[]
     * @param object $step
     */
    protected function buildQuestionItem($step)
    {
        $questionType = $step->options->questionType;
        $wgMap        = array('input' => 'thinkInput', 'radio' => 'thinkRadio', 'checkbox' => 'thinkCheckbox', 'tableInput' => 'thinkTableInput', 'multicolumn' => 'thinkMulticolumn');
        if(!isset($wgMap[$questionType])) return array();

        return createWg($wgMap[$questionType], array(set::step($step), set::questionType($questionType), set::mode('detail'), set::isResult(true)));
    }
}
