function workflow_get_workflow_field_names in Workflow 8
Gets an Options list of field names.
Parameters
\Drupal\Core\Entity\EntityInterface $entity: An entity.
string $entity_type: An entity_type.
string $entity_bundle: An entity.
string $field_name: A field name.
Return value
array An list of field names.
4 calls to workflow_get_workflow_field_names()
- WorkflowManager::executeTransitionsOfEntity in src/
Entity/ WorkflowManager.php - Execute a single transition for the given entity.
- WorkflowTransitionElement::transitionElement in src/
Element/ WorkflowTransitionElement.php - Generate an element.
- workflow_access_node_access_records in modules/
workflow_access/ workflow_access.module - Implements hook_node_access_records().
- workflow_get_field_name in ./
workflow.module - Determines the Workflow field_name of an entity. If an entity has multiple workflows, only returns the first one.
File
- ./
workflow.module, line 426 - Support workflows made up of arbitrary states.
Code
function workflow_get_workflow_field_names(EntityInterface $entity = NULL, $entity_type = '', $entity_bundle = '', $field_name = '') {
$result = [];
foreach (_workflow_info_fields($entity, $entity_type, $entity_bundle, $field_name) as $definition) {
$field_name2 = $definition
->getName();
$result[$field_name2] = $field_name2;
}
return $result;
}