* @param $entityTable
* @param int $entityID
* @param $customFieldExtends
+ * @param $parentOperation
*/
- public static function postProcess(&$params, $entityTable, $entityID, $customFieldExtends) {
+ public static function postProcess(&$params, $entityTable, $entityID, $customFieldExtends, $parentOperation = NULL) {
$customData = CRM_Core_BAO_CustomField::postProcess($params,
$entityID,
$customFieldExtends
);
if (!empty($customData)) {
- self::store($customData, $entityTable, $entityID);
+ self::store($customData, $entityTable, $entityID, $parentOperation);
}
}
public function copyCustomFields($entityID, $newEntityID) {
$entity = CRM_Core_DAO_AllCoreTables::getBriefName(get_class($this));
$tableName = CRM_Core_DAO_AllCoreTables::getTableForClass(get_class($this));
- // Obtain custom values for old event
+ // Obtain custom values for the old entity.
$customParams = $htmlType = [];
$customValues = CRM_Core_BAO_CustomValueTable::getEntityValues($entityID, $entity);
}
}
- // Save Custom Fields for new Event
- CRM_Core_BAO_CustomValueTable::postProcess($customParams, $tableName, $newEntityID, $entity);
+ // Save Custom Fields for new Entity.
+ CRM_Core_BAO_CustomValueTable::postProcess($customParams, $tableName, $newEntityID, $entity, 'create');
}
// copy activity attachments ( if any )