changed CaseInvolvement to reference case provisions

This commit is contained in:
naomi 2022-01-20 10:52:04 +00:00
parent 240a55f54f
commit 6069ac0901

View File

@ -10,8 +10,11 @@ class CaseInvolvement {
public static function userIsInvolved($account, $case) { public static function userIsInvolved($account, $case) {
$actorId = self::getLinkedActorId($account); $actorId = self::getLinkedActorId($account);
$involvedIds = array_column($case->actors_involved->getValue(), 'target_id'); $query = \Drupal::entityQuery('oc_case_provision')
return in_array($actorId, $involvedIds); ->condition('provider', $actorId)
->condition('case', $case);
$results = $query->execute();
return !empty($results);
} }
public static function userIsInvolved_activity($account, $activity) { public static function userIsInvolved_activity($account, $activity) {