GlobalConst :: upsert: Bitrix method

      
<?php 
//  Bitrix\Bizproc\Workflow\Type\GlobalConst :: upsert()
//  /dist/bitrix/modules/bizproc/lib/workflow/type/globalconst.php:46

    
public static function upsert($constId$property)
    {
        
$all = static::getAll();
        
$prevProperty = static::getById($constId);

        if (
$prevProperty)
        {
            
$property += $prevProperty;
        }

        
$all[$constId] = $property $prevProperty;
        return static::
saveAll($all);
    }