unset($value['id']);
}
}
- //lets allow to update primary w/ more cleanly.
- if (!$resetPrimaryId && !empty($value['is_primary'])) {
- $primaryId = TRUE;
- if (is_array($blockIds)) {
- foreach ($blockIds as $blockId => $blockValue) {
- if (!empty($blockValue['is_primary'])) {
- $resetPrimaryId = $blockId;
- break;
- }
- }
- }
- if ($resetPrimaryId) {
- $baoString = 'CRM_Core_BAO_' . $blockName;
- $block = new $baoString();
- $block->selectAdd();
- $block->selectAdd("id, is_primary");
- $block->id = $resetPrimaryId;
- if ($block->find(TRUE)) {
- $block->is_primary = FALSE;
- $block->save();
- }
- }
- }
}
-
+ $baoString = 'CRM_Core_BAO_' . $name;
foreach ($params[$blockName] as $count => $value) {
if (!is_array($value)) {
continue;