<commit_before><?php
/**
 * @author <{$author}>
 * @package <{$fullPackage}>
 */
class <{$className}> extends block_BlockConfiguration
{
<{foreach from=$blockInfo->getParametersInfoArray() item=property}>
	<{if $property->getType() == "Boolean"}>	
	public function <{$property->getPhpGetter()}>()
	{
		if ($this->hasConfigurationParameter('<{$property->getName()}>'))
		{
			return $this->configurationArray['<{$property->getName()}>'] === 'true';
		}
		return $this-><{$property->getPhpGetter()}>DefaultValue();
	}
	
	public function <{$property->getPhpGetter()}>DefaultValue()
	{
<{if $property->hasDefaultValue()}>
<{if $property->getDefaultValue() == 'true'}>
		return true;
<{else}>
		return false;
<{/if}>
<{else}>
		return false;
<{/if}>
	}	
	<{elseif $property->getType() == "Integer"}>
	
	public function <{$property->getPhpGetter()}>()
	{
		if ($this->hasConfigurationParameter('<{$property->getName()}>'))
		{
			return intval($this->configurationArray['<{$property->getName()}>']);
		}
		return $this-><{$property->getPhpGetter()}>DefaultValue();
	}
	
	public function <{$property->getPhpGetter()}>DefaultValue()
	{
<{if $property->hasDefaultValue()}>
<{if $property->getDefaultValue() == "null"}>
		return null;
<{else}>
		return f_util_Convert::toInteger('<{$property->getDefaultValue()}>');
<{/if}>
<{else}>
		return 0;
<{/if}>
	}	
	<{elseif $property->getType() == "Double"}>
	
	public function <{$property->getPhpGetter()}>()
	{
		if ($this->hasConfigurationParameter('<{$property->getName()}>'))
		{
			return floatval($this->configurationArray['<{$property->getName()}>']);
		}
		return $this-><{$property->getPhpGetter()}>DefaultValue();
	}
	
	public function <{$property->getPhpGetter()}>DefaultValue()
	{
<{if $property->hasDefaultValue()}>
		return f_util_Convert::toFloat('<{$property->getDefaultValue()}>');
<{else}>
		return 0.0;
<{/if}>
	}
	<{elseif $property->isDocument()}>
		<{if $property->isArray()}>
		
	public function <{$property->getPhpGetter()}>()
	{
		$result = array();
		if ($this->hasConfigurationParameter('<{$property->getName()}>'))
		{
			$ids = explode(',', $this->configurationArray['<{$property->getName()}>']);
			foreach ($ids as $id) 
			{
				if (is_numeric($id))
				{
					$result[] = DocumentHelper::getDocumentInstance($id);
				}
			}
		}
		return $result;
	}
	
	public function <{$property->getPhpGetter()}>Safe()
	{
		$result = array();
		if ($this->hasConfigurationParameter('<{$property->getName()}>'))
		{
			$ids = explode(',', $this->configurationArray['<{$property->getName()}>']);
			foreach ($ids as $id) 
			{
				if (is_numeric($id))
				{
					try
					{
						$result[] = DocumentHelper::getDocumentInstance($id);
					}
					catch (Exception $e)
					{
						Framework::warn(__METHOD__." ".$e->getMessage());
					}
				}
			}
		}
		return $result;
	}
		
	/**
	 * @return integer[]
	 */	
	public function <{$property->getPhpGetter()}>Ids()
	{
		$result = array();
		if ($this->hasConfigurationParameter('<{$property->getName()}>'))
		{
			$ids = explode(',', $this->configurationArray['<{$property->getName()}>']);
			foreach ($ids as $id) 
			{
				if (is_numeric($id))
				{
					$result[] = intval($id);
				}
			}
		}
		return $result;
	}	
		<{else}>
				
	public function <{$property->getPhpGetter()}>()
	{
		if ($this->hasConfigurationParameter('<{$property->getName()}>'))
		{
			if (is_numeric($this->configurationArray['<{$property->getName()}>']))
			{
				return DocumentHelper::getDocumentInstance($this->configurationArray['<{$property->getName()}>']);
			}
		}
		return null;
	}
	
	public function <{$property->getPhpGetter()}>Safe()
	{
		if ($this->hasConfigurationParameter('<{$property->getName()}>'))
		{
			if (is_numeric($this->configurationArray['<{$property->getName()}>']))
			{
				try
				{
					return DocumentHelper::getDocumentInstance($this->configurationArray['<{$property->getName()}>']);
				}
				catch (Exception $e)
				{
					Framework::warn(__METHOD__." ".$e->getMessage());
				}
			}
		}
		return null;
	}

	/**
	 * @return integer
	 */
	public function <{$property->getPhpGetter()}>Id()
	{
		if ($this->hasConfigurationParameter('<{$property->getName()}>'))
		{
			if (is_numeric($this->configurationArray['<{$property->getName()}>']))
			{
				return intval($this->configurationArray['<{$property->getName()}>']);
			}
		}
		return null;
	}		
		<{/if}>	
	<{else}>	
	
	public function <{$property->getPhpGetter()}>()
	{
		if ($this->hasConfigurationParameter('<{$property->getName()}>'))
		{
			return $this->configurationArray['<{$property->getName()}>'];
		}
		return $this-><{$property->getPhpGetter()}>DefaultValue();
	}
	
	public function <{$property->getPhpGetter()}>AsHtml()
	{
		return f_util_HtmlUtils::textToHtml($this-><{$property->getPhpGetter()}>());
	}
	
	public function <{$property->getPhpGetter()}>DefaultValue()
	{
<{if $property->hasDefaultValue()}>
		return '<{$property->getDefaultValue()}>';
<{else}>
		return null;
<{/if}>
	}	
	<{/if}>
<{/foreach}>
}<commit_msg>[FIX #19529] bloc avec paramètre XHTMLFragment<commit_after><?php
/**
 * @author <{$author}>
 * @package <{$fullPackage}>
 */
class <{$className}> extends block_BlockConfiguration
{
<{foreach from=$blockInfo->getParametersInfoArray() item=property}>
	<{if $property->getType() == "Boolean"}>	
	public function <{$property->getPhpGetter()}>()
	{
		if ($this->hasConfigurationParameter('<{$property->getName()}>'))
		{
			return $this->configurationArray['<{$property->getName()}>'] === 'true';
		}
		return $this-><{$property->getPhpGetter()}>DefaultValue();
	}
	
	public function <{$property->getPhpGetter()}>DefaultValue()
	{
<{if $property->hasDefaultValue()}>
<{if $property->getDefaultValue() == 'true'}>
		return true;
<{else}>
		return false;
<{/if}>
<{else}>
		return false;
<{/if}>
	}	
	<{elseif $property->getType() == "Integer"}>
	
	public function <{$property->getPhpGetter()}>()
	{
		if ($this->hasConfigurationParameter('<{$property->getName()}>'))
		{
			return intval($this->configurationArray['<{$property->getName()}>']);
		}
		return $this-><{$property->getPhpGetter()}>DefaultValue();
	}
	
	public function <{$property->getPhpGetter()}>DefaultValue()
	{
<{if $property->hasDefaultValue()}>
<{if $property->getDefaultValue() == "null"}>
		return null;
<{else}>
		return f_util_Convert::toInteger('<{$property->getDefaultValue()}>');
<{/if}>
<{else}>
		return 0;
<{/if}>
	}	
	<{elseif $property->getType() == "Double"}>
	
	public function <{$property->getPhpGetter()}>()
	{
		if ($this->hasConfigurationParameter('<{$property->getName()}>'))
		{
			return floatval($this->configurationArray['<{$property->getName()}>']);
		}
		return $this-><{$property->getPhpGetter()}>DefaultValue();
	}
	
	public function <{$property->getPhpGetter()}>DefaultValue()
	{
<{if $property->hasDefaultValue()}>
		return f_util_Convert::toFloat('<{$property->getDefaultValue()}>');
<{else}>
		return 0.0;
<{/if}>
	}
	<{elseif $property->isDocument()}>
		<{if $property->isArray()}>
		
	public function <{$property->getPhpGetter()}>()
	{
		$result = array();
		if ($this->hasConfigurationParameter('<{$property->getName()}>'))
		{
			$ids = explode(',', $this->configurationArray['<{$property->getName()}>']);
			foreach ($ids as $id) 
			{
				if (is_numeric($id))
				{
					$result[] = DocumentHelper::getDocumentInstance($id);
				}
			}
		}
		return $result;
	}
	
	public function <{$property->getPhpGetter()}>Safe()
	{
		$result = array();
		if ($this->hasConfigurationParameter('<{$property->getName()}>'))
		{
			$ids = explode(',', $this->configurationArray['<{$property->getName()}>']);
			foreach ($ids as $id) 
			{
				if (is_numeric($id))
				{
					try
					{
						$result[] = DocumentHelper::getDocumentInstance($id);
					}
					catch (Exception $e)
					{
						Framework::warn(__METHOD__." ".$e->getMessage());
					}
				}
			}
		}
		return $result;
	}
		
	/**
	 * @return integer[]
	 */	
	public function <{$property->getPhpGetter()}>Ids()
	{
		$result = array();
		if ($this->hasConfigurationParameter('<{$property->getName()}>'))
		{
			$ids = explode(',', $this->configurationArray['<{$property->getName()}>']);
			foreach ($ids as $id) 
			{
				if (is_numeric($id))
				{
					$result[] = intval($id);
				}
			}
		}
		return $result;
	}	
		<{else}>
				
	public function <{$property->getPhpGetter()}>()
	{
		if ($this->hasConfigurationParameter('<{$property->getName()}>'))
		{
			if (is_numeric($this->configurationArray['<{$property->getName()}>']))
			{
				return DocumentHelper::getDocumentInstance($this->configurationArray['<{$property->getName()}>']);
			}
		}
		return null;
	}
	
	public function <{$property->getPhpGetter()}>Safe()
	{
		if ($this->hasConfigurationParameter('<{$property->getName()}>'))
		{
			if (is_numeric($this->configurationArray['<{$property->getName()}>']))
			{
				try
				{
					return DocumentHelper::getDocumentInstance($this->configurationArray['<{$property->getName()}>']);
				}
				catch (Exception $e)
				{
					Framework::warn(__METHOD__." ".$e->getMessage());
				}
			}
		}
		return null;
	}

	/**
	 * @return integer
	 */
	public function <{$property->getPhpGetter()}>Id()
	{
		if ($this->hasConfigurationParameter('<{$property->getName()}>'))
		{
			if (is_numeric($this->configurationArray['<{$property->getName()}>']))
			{
				return intval($this->configurationArray['<{$property->getName()}>']);
			}
		}
		return null;
	}		
		<{/if}>	
	<{else}>	
	
	public function <{$property->getPhpGetter()}>()
	{
		if ($this->hasConfigurationParameter('<{$property->getName()}>'))
		{
			return $this->configurationArray['<{$property->getName()}>'];
		}
		return $this-><{$property->getPhpGetter()}>DefaultValue();
	}
	
	public function <{$property->getPhpGetter()}>AsHtml()
	{
<{if $property->getType() == "XHTMLFragment"}>
		return f_util_HtmlUtils::renderHtmlFragment($this-><{$property->getPhpGetter()}>());
<{else}>
		return f_util_HtmlUtils::textToHtml($this-><{$property->getPhpGetter()}>());
<{/if}>	
	}
	
	public function <{$property->getPhpGetter()}>DefaultValue()
	{
<{if $property->hasDefaultValue()}>
		return '<{$property->getDefaultValue()}>';
<{else}>
		return null;
<{/if}>
	}	
	<{/if}>
<{/foreach}>
}
{'fraction_non_alphanumeric': 0.23853030749582474, 'fraction_numerical': 0.0010806562530700462, 'mean_word_length': 4.735211267605634, 'pattern_counts': {'":': 0, '<': 165, '<?xml version=': 0, '>': 342, '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': '5041741', 'n_tokens_mistral': 3860, 'n_tokens_neox': 3436, 'n_words': 490}