fixed breadcrumbs so they work for ciac
This commit is contained in:
@ -2,6 +2,7 @@
|
||||
|
||||
namespace Drupal\opencase_cases\Entity;
|
||||
|
||||
use Drupal\Core\Entity\ContentEntityBase;
|
||||
use Drupal\Core\Entity\EntityStorageInterface;
|
||||
use Drupal\Core\Field\BaseFieldDefinition;
|
||||
use Drupal\Core\Entity\RevisionableContentEntityBase;
|
||||
@ -116,6 +117,16 @@ class OCCase extends RevisionableContentEntityBase implements OCCaseInterface
|
||||
else return [];
|
||||
}
|
||||
|
||||
public function getTargetEntity(): ContentEntityBase {
|
||||
if (!$this->oc_target->isEmpty()) {
|
||||
return $this->oc_target->entity;
|
||||
} elseif ($this->hasField('client') && !$this->client->isEmpty()) {
|
||||
return $this->client->entity;
|
||||
} else {
|
||||
throw new \Exception('No target found on case');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
|
Reference in New Issue
Block a user