config = $config; $this->init(); } protected function init() { } public static function getInstance() { if (static::$instance === null) { static::$instance = new static(Config::module('businessprocess')->getSection('global')); } return static::$instance; } /** * All processes readable by the current user * * The returned array has the form => , sorted * by title * * @return array */ abstract public function listProcesses(); /** * All process names readable by the current user * * The returned array has the form => and is * sorted * * @return array */ abstract public function listProcessNames(); /** * All available process names, regardless of eventual restrictions * * @return array */ abstract public function listAllProcessNames(); /** * Whether a configuration with the given name exists * * @param $name * * @return bool */ abstract public function hasProcess($name); /** * @param $name * @return BpConfig */ abstract public function loadProcess($name); /** * Store eventual changes applied to the given configuration * * @param BpConfig $config * * @return mixed */ abstract public function storeProcess(BpConfig $config); /** * @param $name * @return bool Whether the process has been deleted */ abstract public function deleteProcess($name); /** * @param string $name * @return Metadata */ abstract public function loadMetadata($name); }