Esempio n. 1
0
 /**
  * Executes method (creates class and then executes). Returns executed
  * function result.
  *
  * @param string $sFunction name of function to execute
  *
  * @throws oxSystemComponentException system component exception
  */
 public function executeFunction($sFunction)
 {
     // execute
     if ($sFunction && !self::$_blExecuted) {
         if (method_exists($this, $sFunction)) {
             $sNewAction = $this->{$sFunction}();
             self::$_blExecuted = true;
             if (isset($sNewAction)) {
                 $this->_executeNewAction($sNewAction);
             }
         } else {
             // was not executed on any level ?
             if (!$this->_blIsComponent) {
                 /** @var oxSystemComponentException $oEx */
                 $oEx = oxNew('oxSystemComponentException');
                 $oEx->setMessage('ERROR_MESSAGE_SYSTEMCOMPONENT_FUNCTIONNOTFOUND');
                 $oEx->setComponent($sFunction);
                 throw $oEx;
             }
         }
     }
 }