Created
February 14, 2022 07:08
-
-
Save BedrosovaYulia/68787787dfcc5cbd09a7ec64fab8f379 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
class GsResponsibleHistory | |
{ | |
const HL_ID = GS_RESP_HISTORY_APP['HL_ID']; | |
const HL_TABLE_NAME = 'c_responsible_history'; | |
const ENTITY_TYPES = array( | |
"LEAD"=>1, | |
"DEAL"=>2, | |
"CONTACT"=>3, | |
"COMPANY"=>4 | |
); | |
const UNKNOWN_USER_ID = 1; | |
public static function Add( | |
$ENTITY_TYPE, | |
$ENTITY_ID, | |
$RESPONSIBLE_ID){ | |
$now = new DateTime(); | |
$hl = self::GetHL(); | |
$hl::add(array( | |
'UF_DATETIME'=>$now->format('Y-m-d H:i:s'), | |
'UF_ENTITY_TYPE'=>self::ENTITY_TYPES[$ENTITY_TYPE], | |
'UF_ENTITY_ID'=>intval($ENTITY_ID), | |
'UF_RESPONSIBLE_ID'=>intval($RESPONSIBLE_ID), | |
'UF_SOURCE'=>'onupdate', | |
)); | |
} | |
private static function GetHL(){ | |
CModule::IncludeModule('highloadblock'); | |
$hlblock = Bitrix\Highloadblock\HighloadBlockTable::getById( | |
self::HL_ID | |
); | |
if($hlblock = $hlblock->fetch()) | |
{ | |
$entity = Bitrix\Highloadblock\HighloadBlockTable::compileEntity( | |
$hlblock); | |
return $entity->getDataClass(); | |
} | |
return false; | |
} | |
} | |
private static function GetHL(){ | |
CModule::IncludeModule('highloadblock'); | |
hlblock = Bitrix\Highloadblock\HighloadBlockTable::getById( | |
self::HL_ID); | |
$hlblock = $hlblock->fetch()){ | |
$entity = Bitrix\Highloadblock\HighloadBlockTable::compileEntity( | |
$hlblock); | |
$entity->getDataClass(); | |
} | |
return false; | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment