<commit_before><?php
/**
 * catalog_persistentdocument_productdeclination
 * @package catalog.persistentdocument
 */
class catalog_persistentdocument_productdeclination extends catalog_persistentdocument_productdeclinationbase 
	implements catalog_StockableDocument, catalog_DeclinableProduct
{

	/**
	 * @return string
	 */
	public function getDetailBlockName()
	{
		return 'declinedproduct';
	}
	
	/**
	 * @return string
	 */
	public function getLabelForUrl()
	{
		if ($this->getDeclinedproduct()->getShowAxeInList() == 0)
		{
			return $this->getDeclinedproduct()->getLabel();
		}
		return $this->getLabel();
	}

	/**
	 * @param catalog_persistentdocument_shop $shop
	 * @return media_persistentdocument_media[]
	 */
	public function getAllVisuals($shop)
	{
		$visuals = parent::getAllVisuals($shop);
<commit_msg>[FIX #61149] indexation des declinaisons<commit_after><?php
/**
 * catalog_persistentdocument_productdeclination
 * @package catalog.persistentdocument
 */
class catalog_persistentdocument_productdeclination extends catalog_persistentdocument_productdeclinationbase 
	implements catalog_StockableDocument, catalog_DeclinableProduct
{

	/**
	 * Get the indexable document
	 * @param catalog_persistentdocument_compiledproduct $compildedProduct
	 * @return indexer_IndexedDocument
	 */
	public function getIndexedDocumentByCompiledProduct($compildedProduct)
	{
		$indexedDoc = parent::getIndexedDocumentByCompiledProduct($compildedProduct);
		if ($indexedDoc)
		{
			if ($compildedProduct->getShowInList())
			{
				$data = catalog_DeclinedproductService::getInstance()->getShowInListInfos($this->getDeclinedProduct());
				foreach ($data as $grpIndex => $declinationIds)
				{
					if (in_array($this->getId(), $declinationIds, true))
					{
						$texts = array();
						foreach ($declinationIds as $declinationId)
						{
							if ($declinationId != $this->getId())
							{
								$ndec = DocumentHelper::getDocumentInstanceIfExists($declinationId);
								if ($ndec instanceof catalog_persistentdocument_productdeclination)
								{
									$text = $ndec->getHiddenInListIndexedText();
									if ($text) 
									{
										$texts[] = $text;
									}
								}
							}
						}
						if (count($texts))
						{
							$indexedDoc->setText($indexedDoc->getText() . ' ' . implode(' ', $texts));
						}
					}
				}
			}
			
		}
		return $indexedDoc;
	}
	
	/**
	 * @return string
	 */
	protected function getHiddenInListIndexedText()
	{
		return $this->getCodeReference();
	}
	
	/**
	 * @return string
	 */
	public function getDetailBlockName()
	{
		return 'declinedproduct';
	}
	
	/**
	 * @return string
	 */
	public function getLabelForUrl()
	{
		if ($this->getDeclinedproduct()->getShowAxeInList() == 0)
		{
			return $this->getDeclinedproduct()->getLabel();
		}
		return $this->getLabel();
	}

	/**
	 * @param catalog_persistentdocument_shop $shop
	 * @return media_persistentdocument_media[]
	 */
	public function getAllVisuals($shop)
	{
		$visuals = parent::getAllVisuals($shop);

{'fraction_non_alphanumeric': 0.12408759124087591, 'fraction_numerical': 0.00232249502322495, 'mean_word_length': 3.942622950819672, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2228034', 'n_tokens_mistral': 1130, 'n_tokens_neox': 908, 'n_words': 148}