This repository has been archived on 2022-07-12. You can view files and clone it, but cannot push or open issues or pull requests.
opencase/modules/opencase_defaults/src/EntityTypeRelations.php

18 lines
602 B
PHP

<?php
namespace Drupal\opencase_defaults;
/**
* Stuff to do with the relationship of case types to actor types, and activity types to case types
*
*/
class EntityTypeRelations {
public static function getAllowedActivityTypesForCaseType($case_type) {
$caseTypeConfig = \Drupal::entityTypeManager()->getStorage('oc_case_type')->load($case_type);
$allowedActivityTypes = $caseTypeConfig->get('allowedActivityTypes'); // format: ['application' => 'application', 'interview' => 0]
if (!$allowedActivityTypes) $allowedActivityTypes = array();
return $allowedActivityTypes;
}
}