本文整理匯總了PHP中Gems_Util::getConsentRejected方法的典型用法代碼示例。如果您正苦於以下問題:PHP Gems_Util::getConsentRejected方法的具體用法?PHP Gems_Util::getConsentRejected怎麽用?PHP Gems_Util::getConsentRejected使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Gems_Util
的用法示例。
在下文中一共展示了Gems_Util::getConsentRejected方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: processTokenData
/**
* Process the data and return the answers that should be changed.
*
* Storing the changed values is handled by the calling function.
*
* @param \Gems_Tracker_Token $token Gems token object
* @return array Containing the changed values
*/
public function processTokenData(\Gems_Tracker_Token $token)
{
if (!$token->getReceptionCode()->isSuccess()) {
return;
}
$answers = $token->getRawAnswers();
if (isset($answers['informedconsent'])) {
$consent = $this->util->getConsent($answers['informedconsent']);
if ($consent->exists) {
// Is existing consent description as answer
$consentCode = $consent->getDescription();
} else {
if ($answers['informedconsent']) {
// Uses start of consent description as answer (LS has only 5 chars for an answer option)
$consentCode = $this->db->fetchOne("SELECT gco_description FROM gems__consents WHERE gco_description LIKE ? ORDER BY gco_order", $answers['informedconsent'] . '%');
} else {
$consentCode = false;
}
if (!$consentCode) {
if ($answers['informedconsent']) {
// Code not found, use first positive consent
$consentCode = $this->db->fetchOne("SELECT gco_description FROM gems__consents WHERE gco_code != ? ORDER BY gco_order", $this->util->getConsentRejected());
} else {
// Code not found, use first negative consent
$consentCode = $this->db->fetchOne("SELECT gco_description FROM gems__consents WHERE gco_code = ? ORDER BY gco_order", $this->util->getConsentRejected());
}
}
}
$respondent = $token->getRespondent();
$values = array('gr2o_patient_nr' => $respondent->getPatientNumber(), 'gr2o_id_organization' => $respondent->getOrganizationId(), 'gr2o_consent' => $consentCode);
$respondent->getRespondentModel()->save($values);
}
return false;
}
示例2: testConsentRejected
public function testConsentRejected()
{
//Check the ini default
$expected = 'do not use';
$actual = $this->object->getConsentRejected();
$this->assertEquals($expected, $actual);
//Check if we can read from an altered ini file
$project = $this->project;
$expected = 'test';
$project->consentRejected = $expected;
$actual = $this->object->getConsentRejected();
$this->assertEquals($expected, $actual);
//Check for class default when not found in ini
unset($project->consentRejected);
$expected = 'do not use';
$actual = $this->object->getConsentRejected();
$this->assertEquals($expected, $actual);
//Check for incorrect spelling used before 1.5.2
$project->concentRejected = 'test2';
try {
$actual = $this->object->getConsentRejected();
} catch (Exception $e) {
}
$this->assertInstanceOf('Gems_Exception_Coding', $e, 'No failure on misspelled concentRejected in project.ini');
}
示例3: canBeUsed
/**
* Can you use the data with this code
*
* @return boolean
*/
public function canBeUsed()
{
return $this->_get('gco_code') !== $this->util->getConsentRejected();
}
示例4: getConsentCode
/**
*
* @return string
*/
public function getConsentCode()
{
if ($this->hasSuccesCode()) {
if (!isset($this->_gemsData['gco_code'])) {
$this->_ensureRespondentData();
}
return $this->_gemsData['gco_code'];
} else {
return $this->util->getConsentRejected();
}
}