ezcWorkflowDefinitionStorageXml::getCurrentVersion PHP Method

getCurrentVersion() protected method

Returns the current version number for a given workflow name.
protected getCurrentVersion ( string $workflowName ) : integer
$workflowName string
return integer
    protected function getCurrentVersion($workflowName)
    {
        $workflowName = $this->getFilesystemWorkflowName($workflowName);
        $files = glob($this->directory . $workflowName . '_*.xml');
        if (!empty($files)) {
            return (int) str_replace(array($this->directory . $workflowName . '_', '.xml'), '', $files[count($files) - 1]);
        } else {
            return 0;
        }
    }