applyPropertyValueModifiers: Bitrix method

      
<?php 
//  applyPropertyValueModifiers()
//  /dist/bitrix/modules/bizproc/classes/general/activity.php:704

    
private function applyPropertyValueModifiers($fieldName$property$value, array $modifiers)
    {
        if (empty(
$property) || empty($modifiers) || !is_array($property))
            return 
$value;

        
$typeName $typeClass $format null;

        
$rootActivity $this->GetRootActivity();
        
$documentId $rootActivity->GetDocumentId();
        
/** @var CBPDocumentService $documentService */
        
$documentService $this->workflow->GetService("DocumentService");
        
$documentType $this->GetDocumentType();

        
$typesMap $documentService->getTypesMap($documentType);
        foreach (
$modifiers as $m)
        {
            
$m strtolower($m);
            if (isset(
$typesMap[$m]))
            {
                
$typeName $m;
                
$typeClass $typesMap[$m];
            }
            else
            {
                
$format $m;
            }
        }

        if (
$typeName === \Bitrix\Bizproc\FieldType::STRING && $format === 'printable')
        {
            
$typeClass null;
        }

        if (
$typeClass || $format)
        {
            
$fieldTypeObject $documentService->getFieldTypeObject($documentType$property);

            if (
$fieldTypeObject)
            {
                
$fieldTypeObject->setDocumentId($documentId);
                if (
$typeClass)
                    
$value $fieldTypeObject->convertValue($value$typeClass);
                if (
$format)
                    
$value $fieldTypeObject->formatValue($value$format);
            }
            elseif (
$format == 'printable'// compatibility: old printable style
            
{
                
$value $documentService->GetFieldValuePrintable(
                    
$documentId,
                    
$fieldName,
                    
$property['Type'],
                    
$value,
                    
$property
                
);

                if (
is_array($value))
                    
$value implode(", "CBPHelper::MakeArrayFlat($value));
            }
        }
        return 
$value;
    }