Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: 929f4cf17f
Fetching contributors…

Cannot retrieve contributors at this time

55 lines (44 sloc) 1.323 kB
<?php
namespace FreeAgent\WorkflowBundle\Step;
class Step
{
protected $name;
protected $actions = array();
protected $validations = array();
protected $possible_next_steps = array();
public function __construct($name, $configuration = array())
{
$this->name = $name;
$this->actions = array_key_exists('actions', $configuration) ? $configuration['actions'] : array();
$this->validations = array_key_exists('validations', $configuration) ? $configuration['validations'] : array();
$this->possible_next_steps = array_key_exists('possible_next_steps', $configuration) ? $configuration['possible_next_steps'] : array();
}
public function getName()
{
return $this->name;
}
public function getActions()
{
return $this->actions;
}
public function getValidations()
{
return $this->validations;
}
public function getPossibleNextSteps()
{
return $this->possible_next_steps;
}
public function hasValidations()
{
return !empty($this->validations);
}
public function hasActions()
{
return !empty($this->actions);
}
public function hasPossibleNextStep($stepName)
{
return in_array($stepName, $this->getPossibleNextSteps());
}
}
Jump to Line
Something went wrong with that request. Please try again.