Ignore:
Timestamp:
03/12/10 10:59:32 (14 years ago)
Author:
pedroerp
Message:

Ticket #609 - Migração das classes do módulo workflow para a nova factory.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sandbox/workflow/branches/609/lib/factory/Factory.php

    r2223 r2233  
    6464         * @static 
    6565         */ 
    66         public static function getInstance() { 
     66        public static function &getInstance() { 
    6767 
    6868                /* oops. we are in the process space. */ 
     
    9393         * Just forward this call to the correct class. 
    9494         * 
    95          * @todo I must implement it! 
    9695         * @access public 
    9796         * @retun object 
    9897         * @static 
    9998         */ 
    100         public static function newInstance() { 
     99        public static function &newInstance() { 
     100 
     101                /* oops. we are in the process space. */ 
     102                if (Security::isEnabled()) { 
     103 
     104                        /* must instatiate it */ 
     105                        if (is_null(self::$_securedFactory)) 
     106                                self::$_securedFactory = new ProcessFactory(); 
     107 
     108                        $args = func_get_args(); 
     109                        return call_user_func_array(array(self::$_securedFactory, "newInstance"), $args); 
     110 
     111                } 
     112                /* regular module space */ 
     113                else { 
     114 
     115                        /* must instatiate it */ 
     116                        if (is_null(self::$_unsecuredFactory)) 
     117                                self::$_unsecuredFactory = new WorkflowFactory(); 
     118 
     119                        $args = func_get_args(); 
     120                        return call_user_func_array(array(self::$_unsecuredFactory, "newInstance"), $args); 
     121                } 
    101122        } 
    102123} 
Note: See TracChangeset for help on using the changeset viewer.