public function getData(RM_Wizard_Result_Object $obResult) { if (is_null($this->_result_data)) { $this->_result_data = $obResult->getData(); } return $this->_result_data; }
/** * Checks visibility condition * * @param RM_Wizard_Result_Object obResult * @return bool */ public function check(RM_Wizard_Result_Object $obResult) { if (!isNull($this->_related_step)) { if (is_null($this->_values)) { return $obResult->isStepAnswered($this->_related_step); } else { if (!isNull($obResultStep = M('Wizard')->loadResultStepByResultAndStep($obResult, $this->_related_step))) { $data = $obResultStep->getData(); foreach ($this->_values as $k => $possible_values) { foreach ($possible_values as $v) { if (isset($data[$k]) && ($v == 'check isset only' || $data[$k] == $v)) { return TRUE; } } } } return FALSE; } } return TRUE; }
/** * Creates wizard result step object * * @param array data * @param RM_Wizard_Object obWizard * @param RM_Account_iUser obUser * @return RM_Wizard_Result_Object **/ public function createResultStep($data, RM_Wizard_Result_Object $obResult, RM_Wizard_Step $obStep) { $props = array(); $props['data'] = serialize($data); $props['result_id'] = $obResult->id(); $props['step_id'] = $obStep->id(); return $this->_mapper->storage('resultstep')->createObject($props); }
/** * Returns answered step by result * * @param RM_Wizard_Result_Object obResult * @return RM_Store_iRequest<RM_Wizard_Step> **/ public function getStepsByResult(RM_Wizard_Result_Object $obResult) { $query = M('Db')->createQuery($this->_tables['resultstep'] . ' AS rs')->what('s.*')->join('rs', 'LEFT JOIN ' . $this->_tables['step'] . ' AS s ON s.id = rs.step_id')->where('rs.result_id = ?', $obResult->id())->order('order_id'); return $this->_storages['step']->request($query); }