本文整理汇总了PHP中Checker::choice方法的典型用法代码示例。如果您正苦于以下问题:PHP Checker::choice方法的具体用法?PHP Checker::choice怎么用?PHP Checker::choice使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Checker
的用法示例。
在下文中一共展示了Checker::choice方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: processRequest
private function processRequest($hash_out, $hash_in, $type, $choice1 = null, $choice2 = null)
{
$hash_config = LitleOnlineRequest::overideconfig($hash_in);
$hash = LitleOnlineRequest::getOptionalAttributes($hash_in, $hash_out);
Checker::choice($choice1);
Checker::choice($choice2);
$request = Obj2xml::toXml($hash, $hash_config, $type);
$litleOnlineResponse = $this->newXML->request($request, $hash_config, $this->useSimpleXml);
return $litleOnlineResponse;
}
示例2: addTransaction
private function addTransaction($hash_out, $hash_in, $type, $choice1 = null, $choice2 = null)
{
if ($this->closed) {
throw new \RuntimeException("Could not add the transaction. This batchRequest is closed.");
}
if ($this->isFull()) {
throw new \RuntimeException('The transaction could not be added to the batch. It is full.');
}
if ($type == 'accountUpdate' && $this->counts_and_amounts['accountUpdate']['count'] != $this->total_txns) {
throw new \RuntimeException("The transaction could not be added to the batch. The transaction type {$type} cannot be mixed with non-Account Updates.");
} elseif ($type != 'accountUpdate' && $this->counts_and_amounts['accountUpdate']['count'] == $this->total_txns && $this->total_txns > 0) {
throw new \RuntimeException("The transaction could not be added to the batch. The transaction type {$type} cannot be mixed with AccountUpdates.");
}
if (isset($hash_in['reportGroup'])) {
$report_group = $hash_in['reportGroup'];
} else {
$conf = Obj2xml::getConfig(array());
$report_group = $conf['reportGroup'];
}
Checker::choice($choice1);
Checker::choice($choice2);
$request = Obj2xml::transactionToXml($hash_out, $type, $report_group);
if (file_put_contents($this->transaction_file, $request, FILE_APPEND) === FALSE) {
throw new \RuntimeException("A transaction could not be written to the batch file at {$this->transaction_file}. Please check your privilege.");
}
$this->total_txns += 1;
}