You are here

public function Abrconfig::getReferenceType in Access by Reference 8.2

Het the bundle of the abr config

Return value

string

Overrides AbrconfigInterface::getReferenceType

File

src/Entity/Abrconfig.php, line 145

Class

Abrconfig
Defines the abrconfig entity.

Namespace

Drupal\access_by_ref\Entity

Code

public function getReferenceType($readable = false) {
  if ($readable == true) {
    switch ($this
      ->get('reference_type')) {
      case 'user':
        return "User referenced";
      case 'user_mail':
        return "User's mail";
      case 'shared':
        return "Profile value";
      case 'inherit':
        return "Inherit from parent";
      default:
        return $this
          ->get('reference_type');
    }
  }
  else {
    return $this
      ->get('reference_type');
  }
}