[2206] | 1 | <?php |
---|
| 2 | |
---|
[2207] | 3 | /** |
---|
| 4 | * Specialization of the BaseFactory class. |
---|
| 5 | * This class is used to instantiate classes for |
---|
| 6 | * processes. You cannot access this class directly, |
---|
| 7 | * but requests to the Factory frontend class in |
---|
| 8 | * 'secured mode' will be forwarded to this class. |
---|
| 9 | * It should be much more restrictive than its |
---|
| 10 | * older brother (or sister), WorkflowFactory... |
---|
| 11 | * |
---|
| 12 | * @author Pedro Eugênio Rocha |
---|
| 13 | * @package Factory |
---|
| 14 | */ |
---|
[2212] | 15 | final class ProcessFactory extends BaseFactory { |
---|
[2206] | 16 | |
---|
| 17 | |
---|
| 18 | /** |
---|
| 19 | * @var boolean $_instantiated Attribute that stores whether this |
---|
| 20 | * class was instantiated or not. This is used to limit the |
---|
| 21 | * instantiation of this class. |
---|
| 22 | * @access private |
---|
| 23 | * @static |
---|
| 24 | */ |
---|
| 25 | private static $_instantiated = false; |
---|
| 26 | |
---|
| 27 | /** |
---|
| 28 | * Construct the class. This function will inform which classes |
---|
| 29 | * you will be able to instantiate and where to find it. |
---|
| 30 | * This function implements a kind of singleton design pattern too. |
---|
| 31 | * @access public |
---|
| 32 | */ |
---|
| 33 | public function __construct() { |
---|
| 34 | |
---|
| 35 | /* don't let the user to instantiate this class more than once. */ |
---|
| 36 | if (self::$_instantiated) |
---|
| 37 | throw new Exception("You can't instantiate this class again."); |
---|
| 38 | |
---|
| 39 | /* registering allowed classes */ |
---|
| 40 | //$this->registerFileInfo('WorkflowObjects', 'class.WorkflowObjects.inc.php', 'inc'); |
---|
| 41 | |
---|
| 42 | /* ok. no more instances of this class.. */ |
---|
| 43 | self::$_instantiated = true; |
---|
| 44 | } |
---|
| 45 | } |
---|
| 46 | |
---|
| 47 | ?> |
---|