break;
default:
- throw new CRM_Core_Exception("Unrecognized entity type: $entityType");
+ if (strpos($entityType, 'Model') !== FALSE) {
+ $entity = str_replace('Model', '', $entityType);
+ $backboneModel = self::convertCiviModelToBackboneModel(
+ $entity,
+ ts('%1', [1 => $entity]),
+ $availableFields
+ );
+ if (!empty($backboneModel['schema'])) {
+ $civiSchema[$entityType] = $backboneModel;
+ }
+ }
+ if (!isset($civiSchema[$entityType])) {
+ throw new CRM_Core_Exception("Unrecognized entity type: $entityType");
+ }
}
}