}
else {
$params = $this->controller->exportValues($this->_name);
- $params['is_active'] = CRM_Utils_Array::value('is_active', $params, FALSE);
+ $params['is_active'] = $params['is_active'] ?? FALSE;
$params['entity_table'] = 'civicrm_acl_role';
// Figure out which type of object we're permissioning on and set object_table and object_id.
* @return object
*/
public static function create(&$params) {
- $params['is_active'] = CRM_Utils_Array::value('is_active', $params, FALSE);
- $params['is_default'] = CRM_Utils_Array::value('is_default', $params, FALSE);
- $params['is_reserved'] = CRM_Utils_Array::value('is_reserved', $params, FALSE);
+ $params['is_active'] = $params['is_active'] ?? FALSE;
+ $params['is_default'] = $params['is_default'] ?? FALSE;
+ $params['is_reserved'] = $params['is_reserved'] ?? FALSE;
$params['label_type_id'] = CRM_Core_PseudoConstant::getKey('CRM_Core_DAO_PrintLabel', 'label_type_id', 'Event Badge');
foreach ($block as $blkCount => $values) {
$otherBlockId = $migrationInfo['other_details']['location_blocks'][$name][$blkCount]['id'] ?? NULL;
- $mainBlockId = CRM_Utils_Array::value('mainContactBlockId', $migrationInfo['location_blocks'][$name][$blkCount], 0);
+ $mainBlockId = $migrationInfo['location_blocks'][$name][$blkCount]['mainContactBlockId'] ?? 0;
if (!$otherBlockId) {
continue;
}
public static function addTellAFriend(&$params) {
$friendDAO = new CRM_Friend_DAO_Friend();
$friendDAO->copyValues($params);
- $friendDAO->is_active = CRM_Utils_Array::value('is_active', $params, FALSE);
+ $friendDAO->is_active = $params['is_active'] ?? FALSE;
$friendDAO->save();
return $friendDAO;
$formValues['entity_table'] = 'civicrm_contribution_page';
$formValues['entity_id'] = $this->_id;
$formValues['title'] = $formValues['tf_title'];
- $formValues['is_active'] = CRM_Utils_Array::value('tf_is_active', $formValues, FALSE);
+ $formValues['is_active'] = $formValues['tf_is_active'] ?? FALSE;
$formValues['thankyou_title'] = $formValues['tf_thankyou_title'] ?? NULL;
$formValues['thankyou_text'] = $formValues['tf_thankyou_text'] ?? NULL;
$formValues['entity_table'] = 'civicrm_event';
$formValues['entity_id'] = $this->_id;
$formValues['title'] = $formValues['tf_title'];
- $formValues['is_active'] = CRM_Utils_Array::value('tf_is_active', $formValues, FALSE);
+ $formValues['is_active'] = $formValues['tf_is_active'] ?? FALSE;
$formValues['thankyou_title'] = $formValues['tf_thankyou_title'] ?? NULL;
$formValues['thankyou_text'] = $formValues['tf_thankyou_text'] ?? NULL;
$params['group_type'] = [];
}
- $params['is_reserved'] = CRM_Utils_Array::value('is_reserved', $params, FALSE);
- $params['is_active'] = CRM_Utils_Array::value('is_active', $params, FALSE);
+ $params['is_reserved'] = $params['is_reserved'] ?? FALSE;
+ $params['is_active'] = $params['is_active'] ?? FALSE;
$params['custom'] = CRM_Core_BAO_CustomField::postProcess($params,
$this->_id,
'Group'
$dao->entity_id = $this->_id;
$dao->find(TRUE);
$params['id'] = $dao->id;
- $params['is_active'] = CRM_Utils_Array::value('pcp_active', $params, FALSE);
- $params['is_approval_needed'] = CRM_Utils_Array::value('is_approval_needed', $params, FALSE);
- $params['is_tellfriend_enabled'] = CRM_Utils_Array::value('is_tellfriend_enabled', $params, FALSE);
+ $params['is_active'] = $params['pcp_active'] ?? FALSE;
+ $params['is_approval_needed'] = $params['is_approval_needed'] ?? FALSE;
+ $params['is_tellfriend_enabled'] = $params['is_tellfriend_enabled'] ?? FALSE;
CRM_PCP_BAO_PCPBlock::writeRecord($params);
$dao->entity_id = $this->_id;
$dao->find(TRUE);
$params['id'] = $dao->id;
- $params['is_active'] = CRM_Utils_Array::value('pcp_active', $params, FALSE);
- $params['is_approval_needed'] = CRM_Utils_Array::value('is_approval_needed', $params, FALSE);
- $params['is_tellfriend_enabled'] = CRM_Utils_Array::value('is_tellfriend_enabled', $params, FALSE);
+ $params['is_active'] = $params['pcp_active'] ?? FALSE;
+ $params['is_approval_needed'] = $params['is_approval_needed'] ?? FALSE;
+ $params['is_tellfriend_enabled'] = $params['is_tellfriend_enabled'] ?? FALSE;
CRM_PCP_BAO_PCPBlock::writeRecord($params);
if ($returnValues['data_type'] == 'Date') {
$dateFields[$fieldIDs[$key]] = 1;
$actualPHPFormats = CRM_Utils_Date::datePluginToPHPFormats();
- $dateFormat = (array) CRM_Utils_Array::value($returnValues['date_format'], $actualPHPFormats);
+ $dateFormat = (array) ($actualPHPFormats[$returnValues['date_format']] ?? []);
$timeFormat = $returnValues['time_format'] ?? NULL;
}
$this->title = CRM_Utils_Array::value('title', $runnerSpec, ts('Queue Runner'));
$this->queue = $runnerSpec['queue'];
$this->errorMode = CRM_Utils_Array::value('errorMode', $runnerSpec, $this->pickErrorMode($this->queue));
- $this->isMinimal = CRM_Utils_Array::value('isMinimal', $runnerSpec, FALSE);
+ $this->isMinimal = $runnerSpec['isMinimal'] ?? FALSE;
$this->onEnd = $runnerSpec['onEnd'] ?? NULL;
$this->onEndUrl = $runnerSpec['onEndUrl'] ?? NULL;
$this->pathPrefix = CRM_Utils_Array::value('pathPrefix', $runnerSpec, 'civicrm/queue');
}
$recData = $values = $this->controller->exportValues($this->_name);
- $recData['is_active'] = CRM_Utils_Array::value('is_active', $recData, 0);
- $recData['is_default'] = CRM_Utils_Array::value('is_default', $recData, 0);
+ $recData['is_active'] = $recData['is_active'] ?? 0;
+ $recData['is_default'] = $recData['is_default'] ?? 0;
if ($this->_action && (CRM_Core_Action::UPDATE || CRM_Core_Action::ADD)) {
if ($this->_id) {
* list of errors to be posted back to the form
*/
public static function formRule($fields, $files, $self) {
- $is_required = CRM_Utils_Array::value('is_required', $fields, FALSE);
- $is_registration = CRM_Utils_Array::value('is_registration', $fields, FALSE);
- $is_view = CRM_Utils_Array::value('is_view', $fields, FALSE);
- $in_selector = CRM_Utils_Array::value('in_selector', $fields, FALSE);
- $is_active = CRM_Utils_Array::value('is_active', $fields, FALSE);
+ $is_required = $fields['is_required'] ?? FALSE;
+ $is_registration = $fields['is_registration'] ?? FALSE;
+ $is_view = $fields['is_view'] ?? FALSE;
+ $in_selector = $fields['in_selector'] ?? FALSE;
+ $is_active = $fields['is_active'] ?? FALSE;
$errors = [];
if ($is_view && $is_registration) {
'option_group_id' => 'activity_default_assignee',
'name' => $option['name'],
'label' => $option['label'],
- 'is_default' => CRM_Utils_Array::value('is_default', $option, 0),
+ 'is_default' => $option['is_default'] ?? 0,
'is_active' => TRUE,
]);
}