group-8.x-1.x-dev/src/Entity/SharedBundleClassBase.php
src/Entity/SharedBundleClassBase.php
<?php
namespace Drupal\group\Entity;
/**
* Base class for shared bundle classes.
*
* This class takes care of the static methods that would otherwise crash when
* you have one class serving multiple bundles.
*/
class SharedBundleClassBase extends GroupRelationship {
/**
* {@inheritdoc}
*/
public static function create(array $values = []) {
return \Drupal::entityTypeManager()->getStorage('group_content')->create($values);
}
/**
* {@inheritdoc}
*/
public static function load($id) {
return \Drupal::entityTypeManager()->getStorage('group_content')->load($id);
}
/**
* {@inheritdoc}
*/
public static function loadMultiple(?array $ids = NULL) {
return \Drupal::entityTypeManager()->getStorage('group_content')->loadMultiple($ids);
}
}
