<commit_before><?php
/**
 * framework_patch_0361
 * @package modules.framework
 */
class framework_patch_0361 extends patch_BasePatch
{
	/**
	 * Entry point of the patch execution.
	 */
	public function execute()
	{
		foreach (generic_RootfolderService::getInstance()->createQuery()->find() as $folder)
		{
			/* @var $folder generic_persistentdocument_rootfolder */
			$folder->setLabel('m.generic.document.rootfolder.document-name');
			$folder->save();
		}
		
		$ls = LocaleService::getInstance();
		foreach (generic_SystemfolderService::getInstance()->createQuery()->find() as $folder)
		{
			/* @var $folder generic_persistentdocument_systemfolder */
			$label = $ls->cleanOldKey($folder->getLabel());
			if ($label !== false)
			{
				$folder->setLabel($label);
				$folder->save();
			}
		}
	}
}<commit_msg>[UPDATE] Change folder label to use locale key<commit_after><?php
/**
 * framework_patch_0361
 * @package modules.framework
 */
class framework_patch_0361 extends patch_BasePatch
{
	/**
	 * Entry point of the patch execution.
	 */
	public function execute()
	{
		foreach (generic_RootfolderService::getInstance()->createQuery()->find() as $folder)
		{
			/* @var $folder generic_persistentdocument_rootfolder */
			$folder->setLabel('m.generic.document.rootfolder.document-name');
			$folder->save();
		}
		
		$ls = LocaleService::getInstance();
		foreach (generic_SystemfolderService::getInstance()->createQuery()->find() as $folder)
		{
			/* @var $folder generic_persistentdocument_systemfolder */
			$label = $ls->cleanOldKey($folder->getLabel());
			if ($label !== false)
			{
				$folder->setLabel($label);
				$folder->save();
			}
		}
		
		foreach (generic_folderService::getInstance()->createQuery()->add(Restrictions::eq('model', 'modules_order/waitingresponseorderfolder'))->find() as $folder)
		{
			/* @var $folder generic_persistentdocument_folder */
			$folder->setLabel('m.order.document.waitingresponseorderfolder.document-name');
			$folder->save();
		}
		
		foreach (generic_folderService::getInstance()->createQuery()->add(Restrictions::eq('model', 'modules_catalog/noshelfproductfolder'))->find() as $folder)
		{
			/* @var $folder generic_persistentdocument_folder */
			$folder->setLabel('m.catalog.document.noshelfproductfolder.document-name');
			$folder->save();
		}
		
		foreach (generic_folderService::getInstance()->createQuery()->add(Restrictions::eq('model', 'modules_catalog/shopfolder'))->find() as $folder)
		{
			/* @var $folder generic_persistentdocument_folder */
			$folder->setLabel('m.catalog.document.shopfolder.document-name');
			$folder->save();
		}
		
		foreach (generic_folderService::getInstance()->createQuery()->add(Restrictions::eq('model', 'modules_customer/tarifcustomergroupfolder'))->find() as $folder)
		{
			/* @var $folder generic_persistentdocument_folder */
			$folder->setLabel('m.customer.document.tarifcustomergroupfolder.document-name');
			$folder->save();
		}
		
		foreach (generic_folderService::getInstance()->createQuery()->add(Restrictions::eq('model', 'modules_customer/voucherfolder'))->find() as $folder)
		{
			/* @var $folder generic_persistentdocument_folder */
			$folder->setLabel('m.customer.document.voucherfolder.document-name');
			$folder->save();
		}
		
		foreach (generic_folderService::getInstance()->createQuery()->add(Restrictions::eq('model', 'modules_form/recipientGroupFolder'))->find() as $folder)
		{
			/* @var $folder generic_persistentdocument_folder */
			$folder->setLabel('m.form.document.recipientgroupfolder.document-name');
			$folder->save();
		}
		
		foreach (generic_folderService::getInstance()->createQuery()->add(Restrictions::eq('model', 'modules_productreturns/paymentfolder'))->find() as $folder)
		{
			/* @var $folder generic_persistentdocument_folder */
			$folder->setLabel('m.productreturns.document.paymentfolder.label-content');
			$folder->save();
		}
		
		foreach (generic_folderService::getInstance()->createQuery()->add(Restrictions::eq('model', 'modules_productreturns/reasonfolder'))->find() as $folder)
		{
			/* @var $folder generic_persistentdocument_folder */
			$folder->setLabel('m.productreturns.document.reasonfolder.label-content');
			$folder->save();
		}
	
	}
}
{'fraction_non_alphanumeric': 0.17011166547873605, 'fraction_numerical': 0.003801377999524828, 'mean_word_length': 5.2835820895522385, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 63, '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': '6237074', 'n_tokens_mistral': 1408, 'n_tokens_neox': 1229, 'n_words': 171}