/**
  * Singleton function
  */
 public function getInstance()
 {
     if (!self::$instancia instanceof self) {
         self::$instancia = new self();
     }
     return self::$instancia;
 }
Exemple #2
0
 function __construct()
 {
     //instance the helper
     $this->helper = new CatalogoPlanesHelper();
     //Get the instance of the error object
     $this->errorObject = HelperErrors::getInstance();
     parent::__construct();
 }
Exemple #3
0
 /**
  *
  * Call the service
  */
 function callService($objectXML)
 {
     $mainframe =& JFactory::getApplication();
     //Instance the plugin
     try {
         JPluginHelper::importPlugin('amadeus', 'catalogoPlanes');
         $dispatcher =& JDispatcher::getInstance();
         $retval = $dispatcher->trigger('connectCatalogoPlanes', array($objectXML));
         if ($retval[0]["status"] == "0") {
             $helperError = HelperErrors::getInstance();
             $errorCode = $retval[0]["error"]["code"];
             $errorMessage = $retval[0]["error"]["message"];
             $helperError->handleError($errorCode, $errorMessage, $objectXML->type);
             $mainframe->redirect("index.php");
         }
         return $retval[0];
     } catch (Exception $ex) {
         $mainframe->redirect("index.php", JText::_("CATALOG.MSG.ERROR.EXCEPTION"), "error");
     }
 }