/** * Creates an action object from a configuration file or a cache. * * @param string $class * @return mixed */ function &factory($class) { if (!array_key_exists($GLOBALS['PIECE_FLOW_Action_ContextID'], $GLOBALS['PIECE_FLOW_Action_Instances']) || !array_key_exists($class, $GLOBALS['PIECE_FLOW_Action_Instances'][$GLOBALS['PIECE_FLOW_Action_ContextID']])) { Piece_Flow_Action_Factory::load($class); if (Piece_Flow_Error::hasErrors()) { $return = null; return $return; } $GLOBALS['PIECE_FLOW_Action_Instances'][$GLOBALS['PIECE_FLOW_Action_ContextID']][$class] =& new $class(); } return $GLOBALS['PIECE_FLOW_Action_Instances'][$GLOBALS['PIECE_FLOW_Action_ContextID']][$class]; }
/** * Loads an action for preventing that the action become an incomplete class. * * @param string $class * @param string $flowID * @static */ function loadAction($class, $flowID) { if ($flowID == Piece_Unity_Plugin_Dispatcher_Continuation::getFlowID()) { Piece_Flow_Action_Factory::load($class); } }