diff --git a/src/SM/Factory/AbstractFactory.php b/src/SM/Factory/AbstractFactory.php index 37248c7..f195614 100644 --- a/src/SM/Factory/AbstractFactory.php +++ b/src/SM/Factory/AbstractFactory.php @@ -59,7 +59,20 @@ public function get($object, $graph = 'default') $graph )); } - + + /** + * @return array returns available graph names + */ + public function getGraphs() + { + $graphNames = []; + + foreach ($this->configs as $config) { + $graphNames[] = $config['graph']; + } + return $graphNames; + } + /** * {@inheritDoc} */ @@ -84,7 +97,7 @@ public function addConfig(array $config, $graph = 'default') if (!isset($config['class'])) { throw new SMException(sprintf( - 'Index "class" needed for the state machine configuration of graph "%s"', + 'Index "class" needed for the state machine configuration of graph "%s"', $config['graph'] )); }