Core and composer updates

This commit is contained in:
Rob Davies 2017-07-03 16:47:07 +01:00
parent a82634bb98
commit 62cac30480
1118 changed files with 21770 additions and 6306 deletions

View file

@ -20,16 +20,37 @@ use Drupal\workflows\WorkflowInterface;
* label_collection = @Translation("Workflows"),
* handlers = {
* "access" = "Drupal\workflows\WorkflowAccessControlHandler",
* "list_builder" = "Drupal\workflows\WorkflowListBuilder",
* "form" = {
* "add" = "Drupal\workflows\Form\WorkflowAddForm",
* "edit" = "Drupal\workflows\Form\WorkflowEditForm",
* "delete" = "Drupal\workflows\Form\WorkflowDeleteForm",
* "add-state" = "Drupal\workflows\Form\WorkflowStateAddForm",
* "edit-state" = "Drupal\workflows\Form\WorkflowStateEditForm",
* "delete-state" = "Drupal\workflows\Form\WorkflowStateDeleteForm",
* "add-transition" = "Drupal\workflows\Form\WorkflowTransitionAddForm",
* "edit-transition" = "Drupal\workflows\Form\WorkflowTransitionEditForm",
* "delete-transition" = "Drupal\workflows\Form\WorkflowTransitionDeleteForm",
* },
* "route_provider" = {
* "html" = "Drupal\Core\Entity\Routing\AdminHtmlRouteProvider",
* },
* }
* },
* config_prefix = "workflow",
* admin_permission = "administer workflows",
* entity_keys = {
* "id" = "id",
* "label" = "label",
* "uuid" = "uuid",
* },
* links = {
* "add-form" = "/admin/config/workflow/workflows/add",
* "edit-form" = "/admin/config/workflow/workflows/manage/{workflow}",
* "delete-form" = "/admin/config/workflow/workflows/manage/{workflow}/delete",
* "add-state-form" = "/admin/config/workflow/workflows/manage/{workflow}/add_state",
* "add-transition-form" = "/admin/config/workflow/workflows/manage/{workflow}/add_transition",
* "collection" = "/admin/config/workflow/workflows"
* },
* config_export = {
* "id",
* "label",
@ -243,14 +264,6 @@ class Workflow extends ConfigEntityBase implements WorkflowInterface, EntityWith
return $this;
}
/**
* {@inheritdoc}
*/
public function getInitialState() {
$ordered_states = $this->getStates();
return reset($ordered_states);
}
/**
* {@inheritdoc}
*/

View file

@ -145,4 +145,12 @@ abstract class WorkflowTypeBase extends PluginBase implements WorkflowTypeInterf
return FALSE;
}
/**
* {@inheritdoc}
*/
public function getInitialState(WorkflowInterface $workflow) {
$ordered_states = $workflow->getStates();
return reset($ordered_states);
}
}

View file

@ -105,14 +105,6 @@ interface WorkflowInterface extends ConfigEntityInterface {
*/
public function deleteState($state_id);
/**
* Gets the initial state for the workflow.
*
* @return \Drupal\workflows\StateInterface
* The initial state.
*/
public function getInitialState();
/**
* Adds a transition to the workflow.
*

View file

@ -93,6 +93,17 @@ interface WorkflowTypeInterface extends PluginInspectionInterface, DerivativeIns
*/
public function deleteTransition($transition_id);
/**
* Gets the initial state for the workflow.
*
* @param \Drupal\workflows\WorkflowInterface $workflow
* The workflow entity.
*
* @return \Drupal\workflows\StateInterface
* The initial state.
*/
public function getInitialState(WorkflowInterface $workflow);
/**
* Builds a form to be added to the Workflow state edit form.
*