Mercurial > hg > cmmr2012-drupal-site
comparison core/modules/content_moderation/src/StateTransitionValidationInterface.php @ 4:a9cd425dd02b
Update, including to Drupal core 8.6.10
author | Chris Cannam |
---|---|
date | Thu, 28 Feb 2019 13:11:55 +0000 |
parents | c75dbcec494b |
children |
comparison
equal
deleted
inserted
replaced
3:307d7a7fd348 | 4:a9cd425dd02b |
---|---|
2 | 2 |
3 namespace Drupal\content_moderation; | 3 namespace Drupal\content_moderation; |
4 | 4 |
5 use Drupal\Core\Entity\ContentEntityInterface; | 5 use Drupal\Core\Entity\ContentEntityInterface; |
6 use Drupal\Core\Session\AccountInterface; | 6 use Drupal\Core\Session\AccountInterface; |
7 use Drupal\workflows\StateInterface; | |
8 use Drupal\workflows\WorkflowInterface; | |
7 | 9 |
8 /** | 10 /** |
9 * Validates whether a certain state transition is allowed. | 11 * Validates whether a certain state transition is allowed. |
10 */ | 12 */ |
11 interface StateTransitionValidationInterface { | 13 interface StateTransitionValidationInterface { |
21 * @return \Drupal\workflows\Transition[] | 23 * @return \Drupal\workflows\Transition[] |
22 * The list of transitions that are legal for this user on this entity. | 24 * The list of transitions that are legal for this user on this entity. |
23 */ | 25 */ |
24 public function getValidTransitions(ContentEntityInterface $entity, AccountInterface $user); | 26 public function getValidTransitions(ContentEntityInterface $entity, AccountInterface $user); |
25 | 27 |
28 /** | |
29 * Checks if a transition between two states if valid for the given user. | |
30 * | |
31 * @param \Drupal\workflows\WorkflowInterface $workflow | |
32 * The workflow entity. | |
33 * @param \Drupal\workflows\StateInterface $original_state | |
34 * The original workflow state. | |
35 * @param \Drupal\workflows\StateInterface $new_state | |
36 * The new workflow state. | |
37 * @param \Drupal\Core\Session\AccountInterface $user | |
38 * The user to validate. | |
39 * @param \Drupal\Core\Entity\ContentEntityInterface $entity | |
40 * (optional) The entity to be transitioned. Omitting this parameter is | |
41 * deprecated and will be required in Drupal 9.0.0. | |
42 * | |
43 * @return bool | |
44 * Returns TRUE if transition is valid, otherwise FALSE. | |
45 */ | |
46 public function isTransitionValid(WorkflowInterface $workflow, StateInterface $original_state, StateInterface $new_state, AccountInterface $user, ContentEntityInterface $entity = NULL); | |
47 | |
26 } | 48 } |