$name = $dao->display_name;
}
$email = $dao->email;
- $doNotEmail = $dao->do_not_email ? TRUE : FALSE;
- $onHold = $dao->on_hold ? TRUE : FALSE;
- $isDeceased = $dao->is_deceased ? TRUE : FALSE;
+ $doNotEmail = (bool) $dao->do_not_email;
+ $onHold = (bool) $dao->on_hold;
+ $isDeceased = (bool) $dao->is_deceased;
return [$name, $email, $doNotEmail, $onHold, $isDeceased];
}
return [NULL, NULL, NULL, NULL, NULL];
$imageInfo[$contactType]['url'] = $imageUrl;
}
else {
- $isSubtype = (array_key_exists('parent_id', $typeInfo) &&
- $typeInfo['parent_id']
- ) ? TRUE : FALSE;
-
- if ($isSubtype) {
+ if (!empty($typeInfo['parent_id'])) {
$type = CRM_Contact_BAO_ContactType::getBasicType($typeInfo['name']) . '-subtype';
}
else {
WHERE id IN ( $idString )
";
$count = CRM_Core_DAO::singleValueQuery($query);
- return $count > 1 ? TRUE : FALSE;
+ return $count > 1;
}
/**
*/
public static function isActive($contactType) {
$contact = self::contactTypeInfo(FALSE);
- $active = array_key_exists($contactType, $contact) ? TRUE : FALSE;
+ $active = array_key_exists($contactType, $contact);
return $active;
}
$this->assign('otherUfName', $otherUser ? $otherUser['name'] : NULL);
}
- $cmsUser = ($mainUfId && $otherUfId) ? TRUE : FALSE;
+ $cmsUser = $mainUfId && $otherUfId;
$this->assign('user', $cmsUser);
$rowsElementsAndInfo = CRM_Dedupe_Merger::getRowsElementsAndInfo($this->_cid, $this->_oid);
*/
public static function isSearchContext($context) {
$searchContext = CRM_Utils_Array::value($context, self::validContext());
- return $searchContext ? TRUE : FALSE;
+ return (bool) $searchContext;
}
public static function setModeValues() {
*/
public static function buildQuickForm($form, $proxSearch) {
// is proximity search required (2) or optional (1)?
- $proxRequired = ($proxSearch == 2 ? TRUE : FALSE);
+ $proxRequired = ($proxSearch == 2);
$form->assign('proximity_search', TRUE);
$form->add('text', 'prox_street_address', ts('Street Address'), NULL, FALSE);