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.
2018-06-12 15:16:40 +00:00
|
|
|
<?php
|
|
|
|
|
2021-12-04 09:08:11 +00:00
|
|
|
namespace Drupal\opencase_defaults;
|
2018-06-12 15:16:40 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Stuff to do with the relationship of case types to actor types, and activity types to case types
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
class EntityTypeRelations {
|
|
|
|
|
2018-06-13 15:51:14 +00:00
|
|
|
public static function getAllowedActivityTypesForCaseType($case_type) {
|
|
|
|
$caseTypeConfig = \Drupal::entityTypeManager()->getStorage('oc_case_type')->load($case_type);
|
2018-06-18 14:29:24 +00:00
|
|
|
$allowedActivityTypes = $caseTypeConfig->get('allowedActivityTypes'); // format: ['application' => 'application', 'interview' => 0]
|
|
|
|
if (!$allowedActivityTypes) $allowedActivityTypes = array();
|
|
|
|
return $allowedActivityTypes;
|
2018-06-13 15:51:14 +00:00
|
|
|
}
|
2018-06-12 15:16:40 +00:00
|
|
|
}
|