public function ScheduledTransitionsUtility::getTransitions in Scheduled Transitions 2.x
Same name and namespace in other branches
- 8 src/ScheduledTransitionsUtility.php \Drupal\scheduled_transitions\ScheduledTransitionsUtility::getTransitions()
Get scheduled transitions for an entity.
Parameters
\Drupal\Core\Entity\EntityInterface $entity: An entity.
Return value
\Drupal\scheduled_transitions\Entity\ScheduledTransitionInterface[] An array of scheduled transitions.
Overrides ScheduledTransitionsUtilityInterface::getTransitions
File
- src/
ScheduledTransitionsUtility.php, line 116
Class
- ScheduledTransitionsUtility
- Utilities for Scheduled Transitions module.
Namespace
Drupal\scheduled_transitionsCode
public function getTransitions(EntityInterface $entity) : array {
$transitionStorage = $this->entityTypeManager
->getStorage('scheduled_transition');
$ids = $transitionStorage
->getQuery()
->condition('entity__target_type', $entity
->getEntityTypeId())
->condition('entity__target_id', $entity
->id())
->execute();
return $transitionStorage
->loadMultiple($ids);
}