}
// check for both id and contact_id
if ($this->_params[$id][0] == 'id' || $this->_params[$id][0] == 'contact_id') {
- if (
- $this->_params[$id][1] == 'IS NULL' ||
- $this->_params[$id][1] == 'IS NOT NULL'
- ) {
- $this->_where[0][] = "contact_a.id {$this->_params[$id][1]}";
- }
- elseif (is_array($this->_params[$id][2])) {
- $idList = implode("','", $this->_params[$id][2]);
- //why on earth do they put ' in the middle & not on the outside? We have to assume it's
- //to support 'something' so lets add them conditionally to support the api (which is a tested flow
- // so if you are looking to alter this check api test results
- if (strpos(trim($idList), "'") > 0) {
- $idList = "'" . $idList . "'";
- }
-
- $this->_where[0][] = "contact_a.id IN ({$idList})";
- }
- else {
- $this->_where[0][] = self::buildClause("contact_a.id", "{$this->_params[$id][1]}", "{$this->_params[$id][2]}");
- }
+ $this->_where[0][] = self::buildClause("contact_a.id", $this->_params[$id][1], $this->_params[$id][2]);
}
else {
$this->whereClauseSingle($this->_params[$id]);
$this->optionGroup[$dataType]['id'] = $result['id'];
}
elseif ($dataType == 'contact') {
- for ($i=0; $i < 3; $i++) {
- $result = $this->callAPISuccess('Contact', 'create', array('contact_type' => 'Individual', 'email' => substr(sha1(rand()), 0, 7) . '@yahoo.com',));
+ for ($i = 0; $i < 3; $i++) {
+ $result = $this->callAPISuccess('Contact', 'create', array('contact_type' => 'Individual', 'email' => substr(sha1(rand()), 0, 7) . '@yahoo.com'));
$this->optionGroup[$dataType]['values'][$i] = $result['id'];
}
}
$count++;
break;
- //TODO: Test case of Country fields remain as it throws foreign key contraint ONLY in test environment
default:
+ //TODO: Test case of Country fields remain as it throws foreign key contraint ONLY in test environment
$count++;
break;
}