/** * Rule Engine Data Generator * @param $format none | json */ public function toRuleEngineData($format = 'none') { $data = parent::toRuleEngineData(); $data['inBillDnI'] = $this->inBillDnI->toRuleEngineData(); if (strcasecmp($format, 'json') === 0) { return json_encode($data); } else { return $data; } }
/** * Rule Engine Data Generator * @param $format none | json */ public function toRuleEngineData($format = 'none') { $data = parent::toRuleEngineData(); $data['satisfyAll'] = is_null($this->satisfyAll) ? true : $this->satisfyAll; $data['qcList'] = array(); foreach ($this->qcList as $idx => $qc) { $data['qcList'][] = $qc->toRuleEngineData(); } if (strcasecmp($format, 'json') === 0) { return json_encode($data); } else { return $data; } }