本文整理匯總了PHP中Bitrix\Highloadblock\HighloadBlockTable類的典型用法代碼示例。如果您正苦於以下問題:PHP HighloadBlockTable類的具體用法?PHP HighloadBlockTable怎麽用?PHP HighloadBlockTable使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了HighloadBlockTable類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getPropDirectory
function getPropDirectory(&$property)
{
if (empty($property)) {
return false;
}
if (!is_array($property)) {
return false;
}
if (!isset($property['USER_TYPE_SETTINGS']['TABLE_NAME']) || empty($property['USER_TYPE_SETTINGS']['TABLE_NAME'])) {
return false;
}
$highLoadInclude = \Bitrix\Main\Loader::includeModule('highloadblock');
$highBlock = \Bitrix\Highloadblock\HighloadBlockTable::getList(array("filter" => array('TABLE_NAME' => $property['USER_TYPE_SETTINGS']['TABLE_NAME'])))->fetch();
if (!isset($highBlock['ID'])) {
return false;
}
$entity = \Bitrix\Highloadblock\HighloadBlockTable::compileEntity($highBlock);
$entityDataClass = $entity->getDataClass();
$entityList = $entityDataClass::getList();
while ($arEntityItem = $entityList->Fetch()) {
$val =& $property["VALUES"][$arEntityItem["UF_XML_ID"]];
//foreach($property["VALUES"] as &$val){
if (!empty($arEntityItem["UF_FILE"])) {
$property["PICTURE_INCLUDED"] = true;
$arEntityItem["~UF_FILE"] = $arEntityItem["UF_FILE"];
$arEntityItem["PICTURE"] = CFile::GetPath($arEntityItem["~UF_FILE"]);
}
if (!empty($arEntityItem)) {
$val = array_merge($val, $arEntityItem);
}
//}
//echo'<pre>';print_r($arEntityItem);echo'</pre>';
}
return true;
}
示例2:
function __construct($hlblockid)
{
$this->hlBlockID = $hlblockid;
$hlblock = HL\HighloadBlockTable::getById($hlblockid)->fetch();
$entity = HL\HighloadBlockTable::compileEntity($hlblock);
$this->hlHandler = $entity->getDataClass();
}
示例3: UnInstallDB
function UnInstallDB($arParams = array())
{
global $DB, $DBType, $APPLICATION;
$this->errors = false;
if (!array_key_exists("save_tables", $arParams) || $arParams["save_tables"] != "Y") {
// remove user data
CModule::IncludeModule("highloadblock");
$result = \Bitrix\Highloadblock\HighloadBlockTable::getList();
while ($hldata = $result->fetch()) {
\Bitrix\Highloadblock\HighloadBlockTable::delete($hldata['ID']);
}
// remove hl system data
$this->errors = $DB->RunSQLBatch($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/highloadblock/install/db/" . strtolower($DB->type) . "/uninstall.sql");
}
UnRegisterModule("highloadblock");
UnRegisterModuleDependences("main", "OnBeforeUserTypeAdd", "highloadblock", '\\Bitrix\\Highloadblock\\HighloadBlockTable', "OnBeforeUserTypeAdd");
UnRegisterModuleDependences("main", "OnAfterUserTypeAdd", "highloadblock", '\\Bitrix\\Highloadblock\\HighloadBlockTable', "onAfterUserTypeAdd");
UnRegisterModuleDependences("main", "OnBeforeUserTypeDelete", "highloadblock", '\\Bitrix\\Highloadblock\\HighloadBlockTable', "OnBeforeUserTypeDelete");
UnRegisterModuleDependences('main', 'OnUserTypeBuildList', 'highloadblock', 'CUserTypeHlblock', 'GetUserTypeDescription');
UnRegisterModuleDependences('iblock', 'OnIBlockPropertyBuildList', 'highloadblock', 'CIBlockPropertyDirectory', 'GetUserTypeDescription');
if ($this->errors !== false) {
$APPLICATION->ThrowException(implode("<br>", $this->errors));
return false;
}
return true;
}
示例4: __construct
/**
* Constructor.
*
* @param array $params
*
* @throws SkipHandlerException
*/
public function __construct($params)
{
$this->event = $params[0];
$eventParams = $this->event->getParameters();
$this->id = $eventParams['id']['ID'];
$this->fields = HighloadBlockTable::getById($this->id)->fetch();
}
示例5: deleteHlblock
public function deleteHlblock($hlblockId)
{
$result = HL\HighloadBlockTable::delete($hlblockId);
if ($result->isSuccess()) {
return true;
}
$this->throwException(__METHOD__, implode(', ', $result->getErrors()));
}
示例6: connectToBlock
function connectToBlock($blockId)
{
$hlblock_requests = HL\HighloadBlockTable::getById($blockId)->fetch();
//requests
$entity_requests = HL\HighloadBlockTable::compileEntity($hlblock_requests);
$entity_requests_data_class = $entity_requests->getDataClass();
return $entity_requests_data_class;
}
示例7: getUserType
/**
* Check last user type in logs
* @param $userID
*
* @return string
*/
function getUserType($userID)
{
global $USER;
$hbKPI = HL\HighloadBlockTable::getById(HLBLOCK_KPIAMPLIFIER)->fetch();
$entityKPI = HL\HighloadBlockTable::compileEntity($hbKPI);
$entity_data_class = $entityKPI->getDataClass();
$arUserType2R = array("38" => "1", "39" => "2", "40" => "3", "41" => "4", "42" => "5", "44" => "5");
$rsDataHLAll = $entity_data_class::getList(array("select" => array("*"), "order" => array("ID" => "DESC"), "filter" => array("UF_AMPLIFIER" => $USER->GetID(), "UF_USER" => IntVal($userID))));
if ($ar_fieldsGoodAll = $rsDataHLAll->Fetch()) {
return $arUserType2R[$ar_fieldsGoodAll['UF_TYPE_2']];
} else {
return '2';
}
}
示例8: create
/**
* @inheritdoc
*/
public function create(ParameterDictionary $parameters)
{
$highLoadBlockId = (int) $parameters->get('ID');
$highLoadBlock = HL\HighloadBlockTable::getById($highLoadBlockId)->fetch();
if (empty($highLoadBlock)) {
throw new BuilderException(sprintf('Not found highloadblock with id = %d', $highLoadBlockId));
}
$highLoadBlockFields = $this->getUserFieldManager()->GetUserFields(sprintf('HLBLOCK_%d', $highLoadBlockId), 0, LANGUAGE_ID);
$this->setHighLoadBlockFields($highLoadBlockFields);
$this->setElementValue();
$this->setSectionValue();
$this->setEnumValue();
return array('DATA' => $highLoadBlock, 'FIELDS' => $this->getHighLoadBlockFields());
}
示例9: getEntity
/**
* @param $hblockId
* @return \Bitrix\Main\Entity\Base
* @throws \Exception
*/
protected static function getEntity($hblockId)
{
$hblockId = intval($hblockId);
if (self::$hblockEntities[$hblockId]) {
return self::$hblockEntities[$hblockId];
}
$hlData = HighloadBlockTable::getById($hblockId)->fetch();
if (!$hlData) {
throw new \Exception("Hblock {$hblockId} not found");
}
// описание полей hl блока
$obUserField = new \CUserTypeManager();
self::$hblockEntityFields[$hblockId] = $obUserField->GetUserFields('HLBLOCK_' . $hlData['ID'], 0, LANGUAGE_ID);
return self::$hblockEntities[$hblockId] = HighloadBlockTable::compileEntity($hlData);
}
示例10: down
public function down()
{
global $APPLICATION;
$arHlData = $this->arHlData;
\Bitrix\Main\Loader::includeModule("highloadblock");
$arHlblock = \Bitrix\Highloadblock\HighloadBlockTable::getList(array('filter' => array('TABLE_NAME' => \Hawkart\Megatv\PeopleTable::getTableName())))->fetch();
if ($arHlblock) {
foreach ($arHlData as $fieldName => $fieldValue) {
$oUserTypeEntity = new \CUserTypeEntity();
$resProperty = \CUserTypeEntity::GetList(array(), array('ENTITY_ID' => 'HLBLOCK_' . $arHlblock["ID"], 'FIELD_NAME' => $fieldName));
if ($aUserHasField = $resProperty->Fetch()) {
$oUserTypeEntity->Delete($aUserHasField['ID']);
$this->outSuccess("Свойство удалено!");
}
}
}
}
示例11: down
public function down()
{
global $APPLICATION;
\Bitrix\Main\Loader::includeModule("highloadblock");
$arHlblock = \Bitrix\Highloadblock\HighloadBlockTable::getList(array('filter' => array('TABLE_NAME' => \Hawkart\Megatv\SubscribeTable::getTableName())))->fetch();
if ($arHlblock) {
$arProps = array("UF_DATETIME_TO");
foreach ($arProps as $prop_name) {
$oUserTypeEntity = new \CUserTypeEntity();
$resProperty = \CUserTypeEntity::GetList(array(), array('ENTITY_ID' => 'HLBLOCK_' . $arHlblock["ID"], 'FIELD_NAME' => $prop_name));
if ($aUserHasField = $resProperty->Fetch()) {
$oUserTypeEntity->Delete($aUserHasField['ID']);
$this->outSuccess("Свойство 'Дата окончания подписки' удалено!");
}
}
}
}
示例12: changeUserStatus
function changeUserStatus($ID, $PARENT, $CURRENT, $NEW, $text)
{
CModule::IncludeModule("iblock");
CModule::IncludeModule("highloadblock");
global $APPLICATION;
$fields = getValuesList('UF_STATUS', 'USER', 'ID');
$flipFields = array_flip($fields);
$types = array(getValuesList('UF_TYPE', 'HLBLOCK_2', 'ID'), getValuesList('UF_TYPE_2', 'HLBLOCK_2', 'ID'));
$raw = new CUser();
$raw->Update($ID, array('UF_INVITE_STATUS' => 1, 'UF_STATUS' => $fields[$NEW]));
$hbKPI = HL\HighloadBlockTable::getById(2)->fetch();
$entityKPI = HL\HighloadBlockTable::compileEntity($hbKPI);
$logKPI = $entityKPI->getDataClass();
$logKPI::add(array('UF_USER' => intval($ID), 'UF_AMPLIFIER' => intval($PARENT), 'UF_EVENT' => 0, 'UF_DATE_TIME' => date("Y-m-d H:i:s"), 'UF_ACTION_CODE' => 103, 'UF_ACTION_TEXT' => "change_status", 'UF_TYPE' => $CURRENT ? $types[0][$flipFields[$CURRENT]] : 1, 'UF_TYPE_2' => $types[1][$NEW]));
$hbLOG = HL\HighloadBlockTable::getById(4)->fetch();
$entityLOG = HL\HighloadBlockTable::compileEntity($hbLOG);
$logLOG = $entityLOG->getDataClass();
$res = $logLOG::add(array('UF_USER' => intval($ID), 'UF_AMPLIFIER' => intval($PARENT), 'UF_EVENT' => 0, 'UF_DATE_TIME' => date("d.m.Y H:i:s", time()), "UF_ACTION_CODE" => 104, "UF_ACTION_TEXT" => $text, "UF_TYPE" => $CURRENT ? $flipFields[$CURRENT] : 1, "UF_TYPE_2" => $NEW));
}
示例13: getEntityByName
/**
* Ищет данные о сущности по ее названию
* @param string $name
* @return array
*/
public static function getEntityByName($name)
{
if (empty(self::$_entities[$name]) || !array_key_exists($name, self::$_entities[$name])) {
$cid = 'bxar\\helpers\\HlEntity_' . $name;
$obCache = new \CPHPCache();
if ($obCache->InitCache(7200, $cid, '/')) {
self::$_entities[$name] = $obCache->GetVars();
} elseif ($obCache->StartDataCache()) {
$filter = ['select' => ['ID', 'NAME', 'TABLE_NAME'], 'filter' => ['NAME' => $name]];
$hlblock = \Bitrix\Highloadblock\HighloadBlockTable::getList($filter)->fetch();
if (!empty($hlblock['ID'])) {
self::$_entities[$name] = $hlblock;
} else {
self::$_entities[$name] = null;
}
$obCache->EndDataCache(self::$_entities[$name]);
}
}
return self::$_entities[$name];
}
示例14: getFiles
/**
* {@inheritdoc}
*/
public function getFiles($insertId, array $attachFields)
{
$filesList = array();
$builderData = $this->builder->getBuilderData();
$enity = HL\HighloadBlockTable::compileEntity($builderData['DATA']);
$enity = $enity->getDataClass();
$resultDb = $enity::getList(array('filter' => array('ID' => $insertId)));
if (!($fields = $resultDb->fetch())) {
return $filesList;
}
foreach ($fields as $key => $value) {
if (!in_array($key, $attachFields)) {
continue;
}
if (is_numeric($value)) {
$filesList[] = $value;
} elseif (is_array($value)) {
$filesList = array_merge_recursive($filesList, $value);
}
}
return $filesList;
}
示例15: GetCityList
public static function GetCityList() {
$arResult = array();
$rsData = \Bitrix\Highloadblock\HighloadBlockTable::getList(array('filter'=>array('NAME'=>CITY_LIST_HLB)));
if ( !($arData = $rsData->fetch()) ){
echo 'Инфоблок не найден';
} else {
$Entity = \Bitrix\Highloadblock\HighloadBlockTable::compileEntity($arData);
$Query = new \Bitrix\Main\Entity\Query($Entity);
$Query->setSelect(array('*'));
$result = $Query->exec();
$result = new CDBResult($result);
while ($row = $result->Fetch()){
$arResult[$row['UF_CITY_CODE']] = $row['UF_CITY_NAME'];
}
}
return $arResult;
}