本文整理汇总了PHP中Result::getResult方法的典型用法代码示例。如果您正苦于以下问题:PHP Result::getResult方法的具体用法?PHP Result::getResult怎么用?PHP Result::getResult使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Result
的用法示例。
在下文中一共展示了Result::getResult方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Result
function check_suffix()
{
// result to return
$result = new Result();
$result->updateResult($this->check_suffix_with_casual_leave());
if (!$result->getResult()) {
return $result;
}
$result->updateResult($this->check_suffix_with_restricted_leave());
if (!$result->getResult()) {
return $result;
}
return $result;
}
示例2: testGetResultThreshold
/**
* @dataProvider resultThresholdProvider
*/
public function testGetResultThreshold($pos, $neg, $expected)
{
$result = new Result('Test Sample', $pos, $neg);
$this->assertEquals($expected, $result->getResult());
}
示例3: Result
/**
* This function evaluates emptiness of fields
* @return \Result
*/
function is_required_data_filled()
{
$result = new Result();
// check for leave type
if ($_POST[Leave_application::LEAVE_TYPE] == Leave_application::EMPTY_VAL) {
$result->setResult(FALSE);
$result->addError("Please select type of leave.");
}
// check for leave start date
if (empty($_POST[Leave_application::LEAVE_START_DATE])) {
$result->setResult(FALSE);
$result->addError("Please select start date.");
}
// if leave is not of restricted type check for end date
if ($_POST[Leave_application::LEAVE_TYPE] != Leave_constants::$TYPE_RESTRICTED_LEAVE) {
// check for leave end date
if (empty($_POST[Leave_application::LEAVE_END_DATE])) {
$result->setResult(FALSE);
$result->addError("Please select end date.");
}
}
// check for casual leave extra data if start date == end date
if ($_POST[Leave_application::LEAVE_TYPE] === Leave_constants::$TYPE_CASUAL_LEAVE && $_POST[Leave_application::LEAVE_START_DATE] === $_POST[Leave_application::LEAVE_END_DATE] && $result->getResult()) {
// check if half or full is marked
if ($_POST[Leave_application::LEAVE_CASUAL_PERIOD] == Leave_application::EMPTY_VAL) {
$result->setResult(FALSE);
$result->addError("For casual leave of single day, please specify period half or full");
} else {
if ($_POST[Leave_application::LEAVE_CASUAL_PERIOD] == Leave_application::LEAVE_PERIOD_HALF && $_POST[Leave_application::LEAVE_J_NOON] == Leave_application::EMPTY_VAL) {
$result->setResult(FALSE);
$result->addError("Please select in which half you want to take leave, before noon or after noon");
}
}
}
// check for purpose
if (empty($_POST[Leave_application::LEAVE_PURPOSE])) {
$result->setResult(FALSE);
$result->addError("Please mention purpose.");
}
return $result;
}
示例4: die
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
curl_setopt($ch, CURLOPT_USERAGENT, 'Flower-Color-Test-App');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
# Parsing the response
$decoded = json_decode($response, TRUE);
$gistlink = $decoded['html_url'];
die(json_encode(array('success' => true, 'hash' => str_replace('https://gist.github.com/', '', $gistlink))));
}
}
$result = new Result();
if (isset($_GET['TxtFunc'])) {
switch ($_GET['TxtFunc']) {
case 'get':
$resultId = isset($_GET['TxtID']) ? $_GET['TxtID'] : null;
if ($resultId === NULL) {
die(json_decode(array('result' => false, 'message' => 'Please provide result id.')));
}
$result->getResult($resultId);
break;
case 'save':
$resultData = isset($_GET['TxtData']) ? $_GET['TxtData'] : null;
if ($resultData === NULL) {
die(json_decode(array('result' => false, 'message' => 'Please provide result data.')));
}
$result->saveResult($resultData);
break;
}
}
示例5: go
public static function go($queryString, $obj = NULL)
{
$api = new Result($queryString, $obj);
//----------------------------------------------------------
return $api->count ? $api->countResult() : $api->getResult();
}
示例6: testGetResultWithoutValue
/**
* This test checks a that the resolved result is NULL.
*
* @return void
*/
public function testGetResultWithoutValue()
{
$annotation = new Result('Result', array());
$this->assertNull($annotation->getResult());
}