/** * Genereated the item test SOAP object * * @return PlentySoapObject_ItemTexts[] */ protected function getObjectTexts() { $requestItemTexts = array(); //in this array we save all languages that already have a translation of the article description. $languagesUsed = array(); // if the item is active for a shop => save the item descriptions into the shops languages if (!empty($this->storeIds)) { foreach ($this->storeIds as $storeId => $values) { $mainShopId = PlentymarketsMappingController::getShopByPlentyID($storeId); $shopLanguages = PlentymarketsTranslation::getShopActiveLanguages($mainShopId); foreach ($shopLanguages as $key => $language) { $lang = PlentymarketsTranslation::getPlentyLocaleFormat($language['locale']); if (in_array($lang, $languagesUsed)) { //don't save twice the translation for a language continue; } else { // add the language into the used languages list $languagesUsed[] = $lang; } $Object_ItemTexts = new PlentySoapObject_ItemTexts(); $Object_ItemTexts->Lang = $lang; // string if ($key == key(PlentymarketsTranslation::getShopMainLanguage($mainShopId))) { // set the article texts from the main shop $Object_ItemTexts->Keywords = PlentymarketsSoapClient::removeControlChars($this->SHOPWARE_Article->getKeywords()); // string $Object_ItemTexts->LongDescription = PlentymarketsSoapClient::removeControlChars($this->SHOPWARE_Article->getDescriptionLong()); // string $Object_ItemTexts->Name = PlentymarketsSoapClient::removeControlChars($this->SHOPWARE_Article->getName()); // string $Object_ItemTexts->ShortDescription = PlentymarketsSoapClient::removeControlChars($this->SHOPWARE_Article->getDescription()); // string } else { // set the article texts from the language shops $translatedText = PlentymarketsTranslation::getShopwareTranslation($mainShopId, 'article', $this->SHOPWARE_Article->getId(), $key); $Object_ItemTexts->Keywords = PlentymarketsSoapClient::removeControlChars($translatedText['txtkeywords']); $Object_ItemTexts->ShortDescription = PlentymarketsSoapClient::removeControlChars($translatedText['txtshortdescription']); $Object_ItemTexts->Name = PlentymarketsSoapClient::removeControlChars($translatedText['txtArtikel']); $Object_ItemTexts->LongDescription = PlentymarketsSoapClient::removeControlChars($translatedText['txtlangbeschreibung']); } $requestItemTexts[] = $Object_ItemTexts; } } } else { // save the item's description per default into German $Object_ItemTexts = new PlentySoapObject_ItemTexts(); $Object_ItemTexts->Lang = 'de'; // string $Object_ItemTexts->Keywords = PlentymarketsSoapClient::removeControlChars($this->SHOPWARE_Article->getKeywords()); // string $Object_ItemTexts->LongDescription = PlentymarketsSoapClient::removeControlChars($this->SHOPWARE_Article->getDescriptionLong()); // string $Object_ItemTexts->Name = PlentymarketsSoapClient::removeControlChars($this->SHOPWARE_Article->getName()); // string $Object_ItemTexts->ShortDescription = PlentymarketsSoapClient::removeControlChars($this->SHOPWARE_Article->getDescription()); // string $requestItemTexts[] = $Object_ItemTexts; } return $requestItemTexts; }
/** * {@inheritDoc} */ public function getKeywords() { $this->__initializer__ && $this->__initializer__->__invoke($this, 'getKeywords', array()); return parent::getKeywords(); }