Adds all texts belonging to an attribute item.

@param MW_Container_Content_Interface $contentItem Content item
@param MShop_Attribute_Item_Interface $item product item object
@param string $langid Language id
356117
protected function _addItem( MW_Container_Content_Interface $contentItem, MShop_Attribute_Item_Interface $item, $langid )
	{
		$listTypes = array();

		foreach( $item->getListItems( 'text' ) as $listItem ) {
			$listTypes[ $listItem->getRefId() ] = $listItem->getType();
		}

		foreach( $this->_getTextTypes( 'attribute' ) as $textTypeItem )
		{
			$textItems = $item->getRefItems( 'text', $textTypeItem->getCode() );

			if( !empty( $textItems ) )
			{
				foreach( $textItems as $textItem )
				{
					$listType = ( isset( $listTypes[ $textItem->getId() ] ) ? $listTypes[ $textItem->getId() ] : '' );
					$items = array( $langid, $item->getType(), $item->getCode(), $listType, $textTypeItem->getCode(), '', '' );

					// use language of the text item because it may be null
					if( ( $textItem->getLanguageId() == $langid || is_null( $textItem->getLanguageId() ) )
						&& $textItem->getTypeId() == $textTypeItem->getId() )
					{
						$items[0] = $textItem->getLanguageId();
						$items[5] = $textItem->getId();
						$items[6] = $textItem->getContent();
					}

					$contentItem->add( $items );
				}
			}
			else
			{
				$items = array( $langid, $item->getType(), $item->getCode(), 'default', $textTypeItem->getCode(), '', '' );
				$contentItem->add( $items );
			}
		}
	}
1327857
public function setItem($cacheId, $content)
    {
        $cacheId = $this->normalizeKey($cacheId);

        return $this->cache->set($cacheId, $content);
    }
995136
public function packItem(core_kernel_classes_Resource $item, $lang, Directory $directory)
    {
        //use the QtiParser to transform the QTI XML into an assoc array representation
        $content = $this->getXmlByItem($item, $lang);
        //load content
        $qtiParser = new QtiParser($content);
        //validate it
        $qtiParser->validate();
        if (!$qtiParser->isValid()) {
            throw new common_Exception('Invalid QTI content : ' . $qtiParser->displayErrors(false));
        }

        //parse
        $qtiItem = $qtiParser->load();

        return $this->packQtiItem($item, $lang, $qtiItem, $directory);

    }
1203865
public function actionItems($langId, $containerId)
    {
        $items = Nav::find()
            ->where(['nav_container_id' => $containerId, 'is_offline' => false, 'ni.lang_id' => $langId, 'is_deleted' => false])
            ->joinWith(['navItems ni'])
            ->asArray()
            ->all();
        $result = [];

        foreach ($items as $item) {
            // rename from navItems to item
            $item['item'] = reset($item['navItems']);
            unset($item['navItems']);
            $result[$item['parent_nav_id']][] = $item;
        }

        return $result;
    }
807914
def add_item_languages(self, item, languages):
        
        # get the langs we have to add to the TransModelLanguage
        qs = TransLanguage.objects.filter(code__in=languages)
        new_langs = [lang for lang in qs]
        if not new_langs:
            return

        ct_item = ContentType.objects.get_for_model(item)
        item_lan, created = TransItemLanguage.objects.get_or_create(content_type_id=ct_item.id, object_id=item.id)
        item_lan.languages.add(*new_langs)
1162194
function addLanguage($languageKey, $content) {
        //If the langage exists and it's an array, add to it instead of replacing it.
        if (is_array($this->getLanguage($languageKey))) {
            $this->languages[$languageKey][] = $content[0];
            return;
        }
        $this->languages[$languageKey] = $content;
        return $this;
    }
1334099
public function setLanguageId($iLanguageId)
    {
        $iOldLang = $this->_iLanguageId;
        $this->_iLanguageId = $iLanguageId;

        // #0003777: reload content on language change
        if ($iOldLang !== null && $iOldLang != $iLanguageId) {
            try {
                $this->_setArticle($this->getProductId());
            } catch (\OxidEsales\Eshop\Core\Exception\NoArticleException $oEx) {
                \OxidEsales\Eshop\Core\Registry::getUtilsView()->addErrorToDisplay($oEx);
            } catch (\OxidEsales\Eshop\Core\Exception\ArticleInputException $oEx) {
                \OxidEsales\Eshop\Core\Registry::getUtilsView()->addErrorToDisplay($oEx);
            }
        }
    }
1291077
public function updateNodeTranslation(NodeInterface &$node, array $product, string $langcode) {
    $description = (isset($product['attributes']['description'])) ? $product['attributes']['description'] : '';

    $categories = (isset($product['categories'])) ? $product['categories'] : [];

    $config = $this->configFactory->get('acm.connector');
    $sku_field_name = $config->get('sku_field_name') ?: 'field_skus';
    $category_field_name = $config->get('category_field_name');
    $text_format = $config->get('text_format') ?: 'rich_text';

    $node_title = html_entity_decode($product['name']);
    if ($config->get('product_title_use_sku')) {
      $node_title = html_entity_decode($product['sku']);
    }
    $node->setTitle($node_title);
    $body = [
      'value' => $description,
      'format' => $text_format,
    ];
    $node->set('body', $body);

    // Add categories if they're configured to be synced.
    if ($category_field_name) {
      $categories = $this->formatCategories($categories);
      $node->{$category_field_name} = $categories;
    }
    $node->{$sku_field_name} = [$product['sku']];

    if ($config->get('product_publish')) {
      $node->setPublished();
    }
    else {
      $node->setUnpublished();
    }

    // Invoke the alter hook to allow all modules to update the node.
    $this->moduleHandler->alter('acm_sku_product_node_translation_update', $node, $product, $langcode);
  }
566789
protected function getItemRecordOverlayed(Item $item, $language, $systemLanguageContentOverlay)
    {
        $itemRecord = $item->getRecord();

        if ($language > 0) {
            $page = GeneralUtility::makeInstance(PageRepository::class);
            $page->init(false);
            $itemRecord = $page->getRecordOverlay($item->getType(), $itemRecord, $language, $systemLanguageContentOverlay);
        }

        if (!$itemRecord) {
            $itemRecord = null;
        }

        return $itemRecord;
    }
783069
public function setLocale( MShop_Locale_Item_Interface $locale )
	{
		$this->_notifyListeners( 'setLocale.before', $locale );

		$this->_locale = clone $locale;
		$this->_modified = true;

		$this->_notifyListeners( 'setLocale.after', $locale );
	}
44549
public function addCartItem($cartId, $cartItem)
    {
        $cartItem = $this->arraySnakeCase($cartItem);

        $cartItem['cart_id'] = $cartId;
        CartItem::create($cartItem);
    }
1275750
public function setLanguageId( $id )
	{
		if ( $id === $this->getLanguageId() ) { return; }

		if ( $id !== null ) {
			if ( strlen($id) !== 2 || ctype_alpha($id) === false ) {
				throw new MShop_Product_Exception(sprintf('Invalid characters in ISO language code "%1$s"', $id));
			}

			$id = (string) $id;
		}

		$this->_values['langid'] = $id;
		$this->setModified();
	}
188701
public function addItem(Item $item)
    {
        $itemUUID = $item->composeUUID();

        $this->elementsToUpdate[$itemUUID] = $item;
        unset($this->elementsToDelete[$itemUUID]);
    }
269623
public function save(array $data, $locale, $userId = null, $item = null, $itemStatusId = null)
    {
        $itemEntity = $this->itemFactory->createEntity();
        $isNewItem = !$item;

        // check required data
        if ($isNewItem) {
            $this->checkRequiredData($data, true);
            $item = $this->itemFactory->createApiEntity($this->itemFactory->createEntity(), $locale);
        }

        if ($item instanceof ItemInterface) {
            $item = $this->itemFactory->createApiEntity($item, $locale);
        }

        // get user
        $user = $userId ? $this->userRepository->findUserById($userId) : null;

        $contact = null;
        $account = null;
        if ($user) {
            $contact = $user->getContact();
            $account = $contact->getMainAccount();
        }

        // set item data
        $item->setQuantity($this->getProperty($data, 'quantity', null));
        $item->setUseProductsPrice($this->getProperty($data, 'useProductsPrice', true));
        $this->setDate(
            $data,
            'deliveryDate',
            $item->getDeliveryDate(),
            array($item, 'setDeliveryDate')
        );

        // terms of delivery
        $product = null;
        if ($isNewItem) {
            $productData = $this->getProperty($data, 'product');
            if ($productData) {
                // get product and set Product's data to item
                $product = $this->setItemByProductData($productData, $item, $locale);
            }
        }

        // if product is not set, set data manually
        if (!$product) {
            if ($isNewItem) {
                $item->setUseProductsPrice(false);
            }
            $item->setName($this->getProperty($data, 'name', $item->getName()));
            // TODO: set supplier based on if its a string  or object (fetch account and set it to setSupplier)
            $item->setTax($this->getProperty($data, 'tax', $item->getTax()));
            $item->setNumber($this->getProperty($data, 'number', $item->getNumber()));
            $item->setDescription($this->getProperty($data, 'description', $item->getDescription()));
            $item->setQuantityUnit($this->getProperty($data, 'quantityUnit', $item->getQuantityUnit()));
        }

        if (method_exists($item, 'getSupplierName')) {
            $item->setSupplierName($this->getProperty($data, 'supplierName', $item->getSupplierName()));
        }

        // update prices
        $this->updatePrices($item, $data);

        $item->setDiscount($this->getProperty($data, 'discount', $item->getDiscount()));

        // set delivery-address for item
        if (isset($data['deliveryAddress'])) {
            $this->setItemDeliveryAddress($data['deliveryAddress'], $item, $contact, $account);
        }

        // create new item
        if ($item->getId() == null) {
            $item->setCreated(new DateTime());
            $item->setCreator($user);
            $this->em->persist($item->getEntity());

            if (!$itemStatusId = null) {
                $itemStatusId = $itemEntity::STATUS_CREATED;
            }
        }

        if ($itemStatusId) {
            $this->addStatus($item, $itemStatusId);
        }

        // handle attributes
        $this->processAttributes($data, $item, $locale);

        $item->setChanged(new DateTime());
        $item->setChanger($user);

        return $item;
    }
1055199
public function addItem($item, $attribs = [])
    {
        if ($item instanceof DListTitle) {
            $this->addTitle($item);
        } else {
            $this->addDesc($item, $attribs);
        }

        return $this;
    }
200325
protected function buildSitemap($rootPageId, $languageId)
    {
        if ($languageId !== null) {
            // Language lock enabled
            $rootPageLinkTemplate = 'sitemap-r%s-l%s-p###PAGE###.xml.gz';
            $sitemapIndexFileName = 'index-r%s-l%s.xml.gz';
            $sitemapPageFileName  = 'sitemap-r%s-l%s-p%s.xml.gz';
        } else {
            $rootPageLinkTemplate = 'sitemap-r%s-p###PAGE###.xml.gz';
            $sitemapIndexFileName = 'index-r%s.xml.gz';
            $sitemapPageFileName  = 'sitemap-r%s-p%3$s.xml.gz';
        }

        // Init builder
        $generator = $this->objectManager->get('Metaseo\\Metaseo\\Sitemap\\Generator\\XmlGenerator');
        $fileName  = sprintf($rootPageLinkTemplate, $rootPageId, $languageId);

        $generator->indexPathTemplate = $this->generateSitemapLinkTemplate($fileName);

        // Get list of pages
        $pageCount = $generator->pageCount();

        // Index
        $content  = $generator->sitemapIndex();
        $fileName = sprintf($sitemapIndexFileName, $rootPageId, $languageId);
        $this->writeToFile(PATH_site . '/' . $this->sitemapDir . '/' . $fileName, $content);

        // Page
        for ($i = 0; $i < $pageCount; $i++) {
            $content  = $generator->sitemap($i);
            $fileName = sprintf($sitemapPageFileName, $rootPageId, $languageId, $i);
            $this->writeToFile(PATH_site . '/' . $this->sitemapDir . '/' . $fileName, $content);
        }

        return true;
    }
155058
def render_item(self, contentitem):
        
        render_language = get_render_language(contentitem)
        with smart_override(render_language):
            # Plugin output is likely HTML, but it should be placed in mark_safe() to raise awareness about escaping.
            # This is just like Django's Input.render() and unlike Node.render().
            return contentitem.plugin._render_contentitem(self.request, contentitem)