/** * translates an Id to an Alias * * @param array $cfg * @param int $value * @return string alias */ protected function id2alias($cfg, $value) { if (!$value) { return 0; } // is allready an Alias Cached then return it $lookupResult = $this->lookUp_idToUniqAlias($cfg, $value, 0); if ($lookupResult) { return $lookupResult; } // get Extension Config $conf = tx_fbmagento_tools::getExtConfig(); // do Soap Call try { $soapClient = new tx_fbmagento_soapinterface($conf['url'], $conf['username'], $conf['password']); $soapClient->enableCache(isset($cfg['cache']) ? $cfg['cache'] : null); switch ($cfg['type']) { case 'idList': $result = $soapClient->call($cfg['table']); $newValue = $result[$value]; break; default: $result = $soapClient->call($cfg['table'], array($value)); $newValue = $result[$cfg['alias_field']]; break; } } catch (Exception $e) { if ($this->getRealurlRef()->enableDevLog) { t3lib_div::devLog('Typogento Soap Error: ' . $e->getMessage(), 'realurl', -1); } return $value; } return $this->lookUp_newAlias($cfg, $newValue, $value, 0); }
/** * generates an Category as Array for TCA Select fields * * @param array $params * @param object $pObj */ public function itemsProcFunc_categories(&$params, &$pObj) { $conf = tx_fbmagento_tools::getExtConfig(); try { $soapClient = new tx_fbmagento_soapinterface($conf['url'], $conf['username'], $conf['password']); $categories = $soapClient->catalog_category()->tree(); } catch (Exception $e) { tx_fbmagento_tools::displayError('SOAP API Error: ' . $e->getMessage()); } $this->getCategoryItems($params['items'], array($categories)); }