PHP Class ezcWorkflowDefinitionStorageXml, Workflow

The definitions are stored inside the directory specified to the constructor with the name: [workflowName]_[workflowVersion].xml where the name of the workflow has dots and spaces replaced by '_'.
Inheritance: implements ezcWorkflowDefinitionStorage
Afficher le fichier Open project: zetacomponents/workflow Class Usage Examples

Protected Properties

Свойство Type Description
$directory string The directory that holds the XML files.

Méthodes publiques

Méthode Description
__construct ( string $directory = '' ) Constructs a new definition loader that loads definitions from $directory.
conditionToXml ( ezcWorkflowCondition $condition, DOMDocument $document ) : DOMElement "Convert" an ezcWorkflowCondition object into an DOMElement object.
loadByName ( string $workflowName, integer $workflowVersion ) : ezcWorkflow Load a workflow definition from a file.
loadFromDocument ( DOMDocument $document ) : ezcWorkflow Load a workflow definition from a DOMDocument.
save ( ezcWorkflow $workflow ) Save a workflow definition to a file.
saveToDocument ( ezcWorkflow $workflow, integer $workflowVersion ) : DOMDocument Save a workflow definition to a DOMDocument.
variableToXml ( mixed $variable, DOMDocument $document ) : DOMElement "Convert" a PHP variable into an DOMElement object.
xmlToCondition ( DOMElement $element ) : ezcWorkflowCondition "Convert" an DOMElement object into an ezcWorkflowCondition object.
xmlToVariable ( DOMElement $element ) : mixed "Convert" an DOMElement object into a PHP variable.

Méthodes protégées

Méthode Description
getCurrentVersion ( string $workflowName ) : integer Returns the current version number for a given workflow name.
getFilename ( string $workflowName, integer $workflowVersion ) : string Returns the filename with path for given workflow name and version.
getFilesystemWorkflowName ( string $workflowName ) : string Returns a safe filesystem name for a given workflow.

Method Details

__construct() public méthode

$directory must contain the trailing '/'
public __construct ( string $directory = '' )
$directory string The directory that holds the XML files.

conditionToXml() public static méthode

"Convert" an ezcWorkflowCondition object into an DOMElement object.
public static conditionToXml ( ezcWorkflowCondition $condition, DOMDocument $document ) : DOMElement
$condition ezcWorkflowCondition
$document DOMDocument
Résultat DOMElement

getCurrentVersion() protected méthode

Returns the current version number for a given workflow name.
protected getCurrentVersion ( string $workflowName ) : integer
$workflowName string
Résultat integer

getFilename() protected méthode

The name of the workflow file is of the format [workFlowName]_[workFlowVersion].xml
protected getFilename ( string $workflowName, integer $workflowVersion ) : string
$workflowName string
$workflowVersion integer
Résultat string

getFilesystemWorkflowName() protected méthode

This method replaces whitespace and '.' with '_'.
protected getFilesystemWorkflowName ( string $workflowName ) : string
$workflowName string
Résultat string

loadByName() public méthode

When the $workflowVersion argument is omitted, the most recent version is loaded.
public loadByName ( string $workflowName, integer $workflowVersion ) : ezcWorkflow
$workflowName string
$workflowVersion integer
Résultat ezcWorkflow

loadFromDocument() public méthode

Load a workflow definition from a DOMDocument.
public loadFromDocument ( DOMDocument $document ) : ezcWorkflow
$document DOMDocument
Résultat ezcWorkflow

save() public méthode

Save a workflow definition to a file.
public save ( ezcWorkflow $workflow )
$workflow ezcWorkflow

saveToDocument() public méthode

Save a workflow definition to a DOMDocument.
public saveToDocument ( ezcWorkflow $workflow, integer $workflowVersion ) : DOMDocument
$workflow ezcWorkflow
$workflowVersion integer
Résultat DOMDocument

variableToXml() public static méthode

"Convert" a PHP variable into an DOMElement object.
public static variableToXml ( mixed $variable, DOMDocument $document ) : DOMElement
$variable mixed
$document DOMDocument
Résultat DOMElement

xmlToCondition() public static méthode

"Convert" an DOMElement object into an ezcWorkflowCondition object.
public static xmlToCondition ( DOMElement $element ) : ezcWorkflowCondition
$element DOMElement
Résultat ezcWorkflowCondition

xmlToVariable() public static méthode

"Convert" an DOMElement object into a PHP variable.
public static xmlToVariable ( DOMElement $element ) : mixed
$element DOMElement
Résultat mixed

Property Details

$directory protected_oe property

The directory that holds the XML files.
protected string $directory
Résultat string