minor #23700 [Workflow] add getter for workflow (Simperfit)

This PR was merged into the 3.4 branch.

Discussion
----------

[Workflow] add getter for workflow

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #23695
| License       | MIT
| Doc PR        |

Commits
-------

9910ba1ad4 [Workflow] feature: add getter in workflow
This commit is contained in:
Fabien Potencier 2017-08-05 19:32:15 +02:00
commit 3b54ce8d7e
4 changed files with 32 additions and 0 deletions

View File

@ -54,4 +54,12 @@ class MultipleStateMarkingStore implements MarkingStoreInterface
{
$this->propertyAccessor->setValue($subject, $this->property, $marking->getPlaces());
}
/**
* @return string
*/
public function getProperty()
{
return $this->property;
}
}

View File

@ -59,4 +59,12 @@ class SingleStateMarkingStore implements MarkingStoreInterface
{
$this->propertyAccessor->setValue($subject, $this->property, key($marking->getPlaces()));
}
/**
* @return string
*/
public function getProperty()
{
return $this->property;
}
}

View File

@ -26,4 +26,12 @@ final class ClassInstanceSupportStrategy implements SupportStrategyInterface
{
return $subject instanceof $this->className;
}
/**
* @return string
*/
public function getClassName()
{
return $this->className;
}
}

View File

@ -186,6 +186,14 @@ class Workflow
return $this->definition;
}
/**
* @return MarkingStoreInterface
*/
public function getMarkingStore()
{
return $this->markingStore;
}
private function doCan($subject, Marking $marking, Transition $transition)
{
foreach ($transition->getFroms() as $place) {