class HeartbeatTypeService in Heartbeat 8
Class HeartbeatTypeService.
@package Drupal\heartbeat
Hierarchy
- class \Drupal\heartbeat\HeartbeatTypeService
Expanded class hierarchy of HeartbeatTypeService
10 files declare their use of HeartbeatTypeService
- HeartbeatAltServices.php in src/
HeartbeatAltServices.php - HeartbeatBlock.php in src/
Plugin/ Block/ HeartbeatBlock.php - HeartbeatBlockDeriver.php in src/
Plugin/ Derivative/ HeartbeatBlockDeriver.php - HeartbeatEventSubscriber.php in src/
EventSubscriber/ HeartbeatEventSubscriber.php - HeartbeatFeedBlock.php in src/
Plugin/ Block/ HeartbeatFeedBlock.php
1 string reference to 'HeartbeatTypeService'
1 service uses HeartbeatTypeService
File
- src/
HeartbeatTypeService.php, line 15
Namespace
Drupal\heartbeatView source
class HeartbeatTypeService {
/**
* Drupal\Core\Entity\EntityTypeManager definition.
*
* @var EntityTypeManager
*/
protected $entityTypeManager;
/**
+ * Drupal\Core\Entity\EntityTypeBundleInfo definition.
+ *
+ * @var EntityTypeBundleInfo
+ */
protected $entityTypeBundleInfo;
/**
* Drupal\Core\Entity\Query\QueryFactory definition.
*
* @var \Drupal\Core\Entity\Query\QueryFactory
*/
protected $entityQuery;
/**
* Constructor.
* @param EntityTypeManager $entityTypeManager
* @param EntityTypeBundleInfo $entityTypeBundleInfo
* @param QueryFactory $entity_query
*/
public function __construct(EntityTypeManager $entityTypeManager, EntityTypeBundleInfo $entityTypeBundleInfo, QueryFactory $entity_query) {
$this->entityTypeManager = $entityTypeManager;
$this->entityTypeBundleInfo = $entityTypeBundleInfo;
$this->entityQuery = $entity_query;
}
public function getTypes() {
return $this->entityQuery
->get('heartbeat_type')
->sort('weight', 'ASC')
->execute();
}
public function load($id) {
return $this->entityTypeManager
->getStorage('heartbeat_type')
->load($id);
}
public function getEntityBundles(ContentEntityType $entity) {
return $this->entityTypeBundleInfo
->getBundleInfo($entity
->id());
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
HeartbeatTypeService:: |
protected | property | Drupal\Core\Entity\Query\QueryFactory definition. | |
HeartbeatTypeService:: |
protected | property | + * Drupal\Core\Entity\EntityTypeBundleInfo definition. + * + * + | |
HeartbeatTypeService:: |
protected | property | Drupal\Core\Entity\EntityTypeManager definition. | |
HeartbeatTypeService:: |
public | function | ||
HeartbeatTypeService:: |
public | function | ||
HeartbeatTypeService:: |
public | function | ||
HeartbeatTypeService:: |
public | function | Constructor. |