source: sandbox/workflow/branches/609/lib/WorkflowFactory.php @ 2206

Revision 2206, 930 bytes checked in by pedroerp, 14 years ago (diff)

Ticket #609 - Versão inicial das classes de segurança e fábricas.

  • Property svn:executable set to *
Line 
1<?php
2
3class WorkflowFactory extends BaseFactory {
4
5
6        /**
7         * @var boolean $_instantiated Attribute that stores whether this
8         *              class was instantiated or not. This is used to limit the
9         *              instantiation of this class.
10         * @access private
11         * @static
12         */
13        private static $_instantiated = false;
14
15
16        /**
17         * Construct the class. This function will inform which classes
18         * you will be able to instantiate and where to find it.
19         * This function implements a kind of singleton design pattern too.
20         * @access public
21         */
22        public function __construct() {
23
24                /* don't let the user to instantiate this class more than once. */
25                if (self::$_instantiated)
26                        throw new Exception("You can't instantiate this class again.");
27
28                /* registering allowed classes */
29                $this->registerFileInfo('WorkflowObjects', 'class.WorkflowObjects.inc.php', 'inc');
30
31                /* ok. no more instances of this class.. */
32                self::$_instantiated = true;
33        }
34}
35
36?>
Note: See TracBrowser for help on using the repository browser.