You are here

public function OgRole::calculateDependencies in Organic groups 8

Calculates dependencies and stores them in the dependency property.

Return value

$this

Overrides ConfigEntityBase::calculateDependencies

See also

\Drupal\Core\Config\Entity\ConfigDependencyManager

File

src/Entity/OgRole.php, line 325

Class

OgRole
Defines the OG user role entity class.

Namespace

Drupal\og\Entity

Code

public function calculateDependencies() {
  parent::calculateDependencies();

  // Create a dependency on the group bundle.
  $bundle_config_dependency = \Drupal::entityTypeManager()
    ->getDefinition($this
    ->getGroupType())
    ->getBundleConfigDependency($this
    ->getGroupBundle());
  $this
    ->addDependency($bundle_config_dependency['type'], $bundle_config_dependency['name']);
}