• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP CIBlockElement类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中CIBlockElement的典型用法代码示例。如果您正苦于以下问题:PHP CIBlockElement类的具体用法?PHP CIBlockElement怎么用?PHP CIBlockElement使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了CIBlockElement类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: trackStartedTask

function trackStartedTask($stopStartedTask = true)
{
    CModule::IncludeModule('iblock');
    $res = CIBlockElement::GetList(array(), array("IBLOCK_ID" => TASKS_IBLOCK_ID, 'ACTIVE' => 'Y', "PROPERTY_PROGRAMMER" => CUser::GetID(), "PROPERTY_STATUS" => STATUS_LIST_WORK), false, false, array('ID', 'NAME', 'PROPERTY_PROJECT', 'PROPERTY_STATUS_DATE'));
    if ($taskArr = $res->Fetch()) {
        if ($stopStartedTask) {
            CIBlockElement::SetPropertyValuesEx($taskArr['ID'], TASKS_IBLOCK_ID, array('STATUS' => STATUS_LIST_PAUSE));
        }
        $link = TASKS_LIST_URL . $taskArr["PROPERTY_PROJECT_VALUE"] . '/' . $taskArr['ID'] . '/';
        $date = new DateTime($taskArr["PROPERTY_STATUS_DATE_VALUE"]);
        $curdate = new DateTime();
        $diff = $date->diff($curdate);
        $h = $diff->format('%h');
        $i = $diff->format('%i');
        if ($h || $i) {
            $timingText = '';
            if ($h) {
                $timingText = "{$h} ч, ";
            }
            if ($i) {
                $timingText = $timingText . "{$i} мин. ";
            }
            $decTime = $h + $i / 60;
            $decTime = round($decTime, 2);
            $el = new CIBlockElement();
            if ($el->Add(array("DATE_ACTIVE_FROM" => ConvertTimeStamp(time(), "SHORT"), "MODIFIED_BY" => CUser::GetID(), "IBLOCK_SECTION_ID" => false, "IBLOCK_ID" => TRACKING_IBLOCK_ID, "NAME" => 'Без названия' . ' (' . $decTime . 'ч.)', "ACTIVE" => "Y", "PROPERTY_VALUES" => array("HOURS" => $decTime, "TASK" => $taskArr['ID'])))) {
                crmEntitiesHelper::recalcTaskTracking($taskArr['ID']);
                ToolTip::Add("+ {$timingText} в трекер задачи \"<a target=\"_blank\" href=\"{$link}\">{$taskArr['ID']} {$taskArr['NAME']}</a>\"");
            } else {
                ToolTip::AddError($el->LAST_ERROR);
            }
        }
    }
}
开发者ID:kudin,项目名称:crm,代码行数:34,代码来源:functions.php


示例2: executeComponent

 function executeComponent()
 {
     $arFilter = array('IBLOCK_ID' => $this->arParams['IBLOCK_ID'], 'ACTIVE' => 'Y');
     if (true || $this->StartResultCache()) {
         $CIBlockElement = new CIBlockElement();
         $CFile = new \CFile();
         $aElts = array();
         $eltsSelectFields = array_merge(array('ID', 'NAME', 'CODE', 'PREVIEW_PICTURE', 'DETAIL_PICTURE', 'DETAIL_PAGE_URL'), $this->getIBlockProperties($this->arParams['IBLOCK_ID']));
         $rsElts = $CIBlockElement->GetList(array('SORT' => 'asc', 'date_active_from' => 'DESC'), $arFilter, false, false, array('ID', 'NAME'));
         if (intval($rsElts->SelectedRowsCount())) {
             while ($arElt = $rsElts->Fetch()) {
                 $aElts[] = array('ID' => $arElt['ID'], 'NAME' => $arElt['NAME']);
             }
             $arElt = $CIBlockElement->GetList(array('SORT' => 'asc', 'ID' => 'DESC'), array_merge($arFilter, array('ID' => $aElts[0]['ID'])), false, false, $eltsSelectFields)->GetNext();
             if ($arElt['DETAIL_PICTURE']) {
                 $arElt['DETAIL_PICTURE'] = $CFile->GetPath($arElt['DETAIL_PICTURE']);
             } elseif ($arElt['PREVIEW_PICTURE']) {
                 $arElt['DETAIL_PICTURE'] = $CFile->GetPath($arElt['PREVIEW_PICTURE']);
             }
             $arPrice = CPrice::GetList(array(), array("PRODUCT_ID" => $arElt['ID']))->Fetch();
             $arElt['PRICE'] = $arPrice['PRICE'];
             $this->arResult['ITEMS'] = $aElts;
             $this->arResult['ITEM'] = $arElt;
             $this->IncludeComponentTemplate();
         }
     }
 }
开发者ID:AlexPrya,项目名称:redvent.ru,代码行数:27,代码来源:class.php


示例3: transformTags

 public function transformTags($aOldTags, $aNewTags, $bSaveOldTags = false, $sOperation = false)
 {
     $aElements = $this->getMaterialsByTags($aOldTags);
     $mResult = array('iTotalElements' => count($aElements), 'iProcessedElements' => 0, 'aErrorElementID' => array());
     if (!empty($aElements)) {
         $oElement = new CIBlockElement();
         foreach ($aElements as $aElement) {
             $aTags = explode(',', $aElement['TAGS']);
             $aNewTags = array_map('trim', array_unique(array_merge($aTags, $aNewTags)));
             if (!$bSaveOldTags) {
                 foreach ($aNewTags as $iKey => &$sTag) {
                     $sTag = trim($sTag);
                     if (in_array($sTag, $aOldTags)) {
                         unset($aNewTags[$iKey]);
                     }
                 }
             }
             //var_dump($aElement['TAGS'],implode( ', ', $aNewTags ) );
             $bResult = $oElement->Update($aElement['ID'], array('TAGS' => implode(', ', $aNewTags)));
             if ($bResult) {
                 $mResult['iProcessedElements']++;
             } else {
                 $mResult['aErrorElementID'][] = array('ID' => $aElement['ID'], 'IBLOCK_ID' => $aElement['IBLOCK_ID'], 'FORMATTED_LINK' => $this->getElementLink($aElement));
             }
         }
     }
     return $mResult;
 }
开发者ID:ASDAFF,项目名称:Bitrix.TagsManager,代码行数:28,代码来源:CTagsManagerDriver_IBlock.class.php


示例4: storeResult

function storeResult($arResult, $arParams) {
    $iblock = CIBlock::GetList(
        array(),
        array(
            'TYPE' => $arParams['IBLOCK_TYPE'],
            'CODE' => $arParams['IBLOCK_CODE'],
        )
    );
    $iblock = $iblock->Fetch();
    
    $el = new CIBlockElement;

    $props = array();
    foreach ($arResult['FIELDS_LIST'] as $arField) {
        if ($arField['FIELD_TYPE'] == 'TEXT' || $arField['FIELD_TYPE'] == 'NUMBER') {
            $props[$arField['CODE']] = array(
                'VALUE' => $arResult['POST_DATA']['~'.$arField['CODE']],
            );
        } elseif ($arField['FIELD_TYPE'] == 'TEXTAREA') {
            $props[$arField['CODE']] = array(
                'VALUE' => array(
                    'TYPE' => 'text',
                    'TEXT' => $arResult['POST_DATA']['~'.$arField['CODE']],
                ),
            );
        } elseif ($arField['FIELD_TYPE'] == 'LIST') {
            $propEnum = CIBlockPropertyEnum::GetList(
                array(),
                array(
                    'XML_ID' => $arResult['POST_DATA']['~'.$arField['CODE']],
                    'CODE' => $arField['CODE'],
                    'IBLOCK_ID' => $iblock['ID'],
                )
            );
            $propEnum = $propEnum->Fetch();
            if ( ! $propEnum) return false;

            $props[$arField['CODE']] = array(
                'VALUE' => $propEnum['ID'],
            );
        }
    }

    $res = $el->Add(array(
        'IBLOCK_TYPE' => $arParams['IBLOCK_TYPE'],
        'IBLOCK_ID' => $iblock['ID'],
        'ACTIVE' => 'Y',
        'PROPERTY_VALUES' => $props,
        'ACTIVE_FROM' => ConvertTimeStamp(time()+CTimeZone::GetOffset(), 'FULL'),
        'NAME' => 'Form result', # !!! NEED TO REPLACE TO DEFAULT VALUE
    ));

    if (!$res) {
        return array(
            'MESSAGE' => $el->LAST_ERROR,
        );
    }

    return true;
}
开发者ID:ASDAFF,项目名称:bitrix-advanced-form,代码行数:60,代码来源:store_result.php


示例5: AddProduct

 function AddProduct($NAME)
 {
     $iblock_permission = CIBlock::GetPermission(IBLOCK_ID);
     if ($iblock_permission < "W") {
         $GLOBALS["USER"]->RequiredHTTPAuthBasic();
         return new CSOAPFault('Server Error', 'Unable to authorize user.');
     }
     $code = self::translit($NAME);
     $i = 1;
     while (true) {
         $res = CIBlockElement::Getlist(array(), array("CODE" => $code), false, array("CODE"));
         if ($res->Fetch()) {
             $code = self::translit($NAME) . $i;
         } else {
             break;
         }
         $i++;
     }
     $arFields = array("IBLOCK_ID" => IBLOCK_ID, "NAME" => $NAME);
     $ib_element = new CIBlockElement();
     $result = $ib_element->Add($arFields);
     if ($result > 0) {
         return $result;
     }
     return new CSOAPFault('Server Error', 'Error: ' . $ib_element->LAST_ERROR);
 }
开发者ID:doppler324,项目名称:componentforworkingwithbitrix,代码行数:26,代码来源:HelperProduct.php


示例6: Execute

 public function Execute()
 {
     if (!CModule::IncludeModule("intranet")) {
         return CBPActivityExecutionStatus::Closed;
     }
     $absenceIblockId = COption::GetOptionInt("intranet", 'iblock_absence', 0);
     if ($absenceIblockId <= 0) {
         return CBPActivityExecutionStatus::Closed;
     }
     $rootActivity = $this->GetRootActivity();
     $documentId = $rootActivity->GetDocumentId();
     $documentService = $this->workflow->GetService("DocumentService");
     $arAbsenceUserTmp = $this->AbsenceUser;
     $arAbsenceUser = CBPHelper::ExtractUsers($arAbsenceUserTmp, $documentId, false);
     $arAbsenceTypes = array();
     $dbTypeRes = CIBlockPropertyEnum::GetList(array("SORT" => "ASC", "VALUE" => "ASC"), array('IBLOCK_ID' => $absenceIblockId, 'PROPERTY_ID' => 'ABSENCE_TYPE'));
     while ($arTypeValue = $dbTypeRes->GetNext()) {
         $arAbsenceTypes[$arTypeValue['XML_ID']] = $arTypeValue['ID'];
     }
     foreach ($arAbsenceUser as $absenceUser) {
         $arFields = array("ACTIVE" => "Y", "IBLOCK_ID" => $absenceIblockId, 'ACTIVE_FROM' => $this->AbsenceFrom, 'ACTIVE_TO' => $this->AbsenceTo, "NAME" => $this->AbsenceName, "PREVIEW_TEXT" => $this->AbsenceDesrc, "PREVIEW_TEXT_TYPE" => "text", "PROPERTY_VALUES" => array("USER" => $absenceUser, "STATE" => $this->AbsenceState, "FINISH_STATE" => $this->AbsenceFinishState, "ABSENCE_TYPE" => $arAbsenceTypes[$this->AbsenceType]));
         $el = new CIBlockElement();
         $el->Add($arFields);
     }
     return CBPActivityExecutionStatus::Closed;
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:26,代码来源:absenceactivity.php


示例7: getFiles

 /**
  * {@inheritdoc}
  */
 public function getFiles($insertId, array $attachFields)
 {
     $filesList = array();
     $iblockElement = new \CIBlockElement();
     $builderData = $this->builder->getBuilderData();
     $filter = array('ID' => $insertId, 'IBLOCK_ID' => $builderData['DATA']['ID']);
     $elementDb = $iblockElement->getList(array(), $filter, false, false, array());
     if (!($element = $elementDb->getNextElement())) {
         return $filesList;
     }
     $fields = $element->getFields();
     foreach ($fields as $key => $value) {
         if (in_array($key, $attachFields) && is_numeric($value)) {
             $filesList[] = $value;
         }
     }
     $propertyList = $element->getProperties();
     foreach ($propertyList as $key => $property) {
         if (!in_array($key, $attachFields)) {
             continue;
         }
         if (is_numeric($property['VALUE'])) {
             $filesList[] = $property['VALUE'];
         } elseif (is_array($property['VALUE'])) {
             $filesList = array_merge_recursive($filesList, $property['VALUE']);
         }
     }
     return $filesList;
 }
开发者ID:ASDAFF,项目名称:citfact.form,代码行数:32,代码来源:IBlockAttach.php


示例8: taskInsertElement

 /**
  * TASK performs with ACTION = INSERT
  *
  * @param int $limit
  * @return string
  */
 public static function taskInsertElement($limit = 500)
 {
     if (($limit = (int) $limit) < 0) {
         return;
     }
     $iblockElement = new \CIBlockElement();
     $connection = \Bitrix\Main\Application::getConnection();
     $sqlHelper = $connection->getSqlHelper();
     // We get a task with the `ACTION` of `INSERT`
     $sql = "\n            SELECT t1.ID as TASK_ID, t1.PARAMS, t1.FILTER_USER_ID, t3.*\n            FROM b_citfact_filter_subscribe_stack as t1\n            LEFT JOIN b_citfact_filter_subscribe_user as t2 ON t2.ID = t1.FILTER_USER_ID\n            LEFT JOIN b_citfact_filter_subscribe as t3 ON t3.ID = t2.FILTER_USER\n            WHERE t1.ACTION = 'INSERT' AND t3.ACTIVE = 'N'\n            LIMIT 1\n        ";
     $task = (array) $connection->query($sql)->fetch();
     if (!empty($task)) {
         $filter['IBLOCK_ID'] = $task['IBLOCK_ID'];
         if ($task['SECTION_ID'] > 0) {
             $filter['SECTION_ID'] = $task['SECTION_ID'];
         }
         $filter = array_merge($filter, unserialize($task['FILTER']));
         $elementResult = $iblockElement->GetList(array('ID' => 'ASC'), $filter, false, array('nTopCount' => $limit), array('ID'));
         while ($element = $elementResult->fetch()) {
             Model\SubscribeNotifyTable::add(array('FILTER_USER_ID' => $task['FILTER_USER_ID'], 'ELEMENT_ID' => $element['ID']));
         }
         Model\SubscribeStackTable::delete(array('ID' => $task['TASK_ID']));
     }
     return "Citfact\\FilterSubscribe\\Agent::taskInsertElement({$limit})";
 }
开发者ID:ASDAFF,项目名称:citfact.filter.subscribe,代码行数:31,代码来源:Agent.php


示例9: agent_kingcoupon_pars

/**
 * Created by JetBrains PhpStorm.
 * User: oleg
 * Date: 01.10.12
 * Time: 21:06
 * To change this template use File | Settings | File Templates.
 */
function agent_kingcoupon_pars()
{
    require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_before.php";
    CModule::IncludeModule("iblock");
    CModule::IncludeModule("mytb");
    $content = file_get_contents("http://kingcoupon.ru/offer/category/Food/");
    preg_match_all("#kingcoupon\\.ru/offer/([0-9]+)/#is", $content, $arr);
    $xml = file_get_contents("http://kingcoupon.ru/offer/export/?refId=100132540459877345");
    $svg = new SimpleXMLElement($xml);
    $clubListID = array();
    foreach ($arr[1] as $var) {
        $clubListID[$var] = $var;
    }
    foreach ($svg->offers->offer as $var) {
        $R = array();
        if (in_array($var->id, $arr[1])) {
            $R['clubName'] = (string) $var->supplier->name;
            foreach ((array) $var->supplier->addresses as $address) {
                if (is_array($address)) {
                    foreach ((array) $address as $var1) {
                        $R['clubAdress'][] = (string) $var1->name;
                    }
                } else {
                    $R['clubAdress'][] = $address->name;
                }
            }
            foreach ((array) $var->supplier->tel as $tel) {
                $R['clubPhone'][] = $tel;
            }
            $id = $var->id;
            $url = preg_replace("#http://#i", "", $var->supplier->url);
            $url = preg_replace("#^([^/]+)/.*#i", "\\1", $url);
            $url = str_replace("www.", "", $url);
            $R['url'] = $url;
            $arSelect = array("ID", "NAME");
            $arFilter = array("IBLOCK_ID" => IB_CLUB_ID, "PROPERTY_SITE" => "%" . $url . "%");
            $res = CIBlockElement::GetList(array("SORT" => "DESC"), $arFilter, FALSE, FALSE, $arSelect);
            if (!$res->Fetch()) {
                $PROP = array();
                //                $PROP["PHONE"]   = $R['clubPhone'];
                //                $PROP["ADDRESS"] = $R['clubAdress'];
                $PROP["SITE"] = $R['url'];
                $PROP["LIST"] = array(54);
                $el = new CIBlockElement();
                $arLoadProductArray = array("IBLOCK_ID" => IB_CLUB_ID, "PROPERTY_VALUES" => $PROP, "NAME" => $R['clubName'], "TAGS" => "kingcoupon", "ACTIVE" => "Y", "SORT" => "0");
                if ($PRODUCT_ID = $el->Add($arLoadProductArray)) {
                    foreach ($R['clubAdress'] as $addressItem) {
                        MyTbCore::Add(array("CLUB_ID" => $PRODUCT_ID, "SITY_ID" => 1, "ADDRESS" => $addressItem, "PHONE" => serialize($R['clubPhone'])), "address");
                        printAr($addressItem);
                    }
                } else {
                    echo "Error: " . $el->LAST_ERROR;
                }
            }
        }
    }
    return "agent_kingcoupon_pars();";
}
开发者ID:nProfessor,项目名称:Mytb,代码行数:65,代码来源:kingcoupon_pars.php


示例10: executeDown

 function executeDown()
 {
     CModule::IncludeModule('iblock');
     $obj_ib_element = new CIBlockElement();
     $r = $obj_ib_element->Delete(2);
     if (!$r) {
         throw new \Exception('Fail do remove element with id = 1');
     }
     return true;
 }
开发者ID:u-mulder,项目名称:bixmigs,代码行数:10,代码来源:Mgr_20150101_102030_task_2001.php


示例11: connectToUser

 public static function connectToUser($userID, $providerName, $userProfile)
 {
     CModule::IncludeModule("iblock");
     $el = new \CIBlockElement();
     $PROP = array();
     $PROP["USER_ID"] = $userID;
     $PROP["SOCIAL_PROVIDER"] = $providerName;
     $PROP["SOCIAL_ID"] = $userProfile["identifier"];
     $arLoadProductArray = array("IBLOCK_SECTION_ID" => false, "IBLOCK_ID" => USER_SOCIAL_IB, "PROPERTY_VALUES" => $PROP, "NAME" => trim("Пользователь №" . $userID), "ACTIVE" => "Y");
     $el->Add($arLoadProductArray);
     \CUserEx::capacityAdd($userID, 1);
 }
开发者ID:Hawkart,项目名称:megatv,代码行数:12,代码来源:CSocialAuth.php


示例12: save

 public function save()
 {
     \Bitrix\Main\Loader::includeModule("iblock");
     $errors =& $this->arResult["forms"][$this->request->getPost("id")]["errors"];
     $el = new CIBlockElement();
     $this->element_id = $el->Add(array("IBLOCK_ID" => 4, "NAME" => "({$this->arResult["forms"][$this->request->getPost("id")]["title"]})Обращение от {$this->request->getPost("first_name")} {$this->request->getPost("last_name")}", "PREVIEW_TEXT" => $this->request->getPost("comment"), "PROPERTY_VALUES" => array("TREATMENT_REASON" => $this->request->getPost("reason_for_treatment"), "PHONE" => $this->request->getPost("phone"), "EMAIL" => $this->request->getPost("email"), "FILE" => $this->request->getFile("file"))));
     if ($this->element_id !== false) {
         return true;
     }
     $errors[] = $res->LAST_ERROR;
     return false;
 }
开发者ID:dimabresky,项目名称:new-channel-site-project-source-code,代码行数:12,代码来源:class.php


示例13: getOptions

 /**
  * Метод вернет массив параметров из инфоблока "Параметры Автонаценки".
  *
  * @return array
  */
 function getOptions()
 {
     $filterParams = array('ACTIVE' => 'Y', 'IBLOCK_CODE' => 'autoprice_options');
     $orderParams = array('SORT' => 'ASC');
     $selectParams = array('ID', 'IBLOCK_SECTION_ID', 'NAME', 'CODE', 'PROPERTY_PARAM', 'PROPERTY_MARKUP');
     $result = array();
     $iBlockElement = new CIBlockElement();
     $dbElements = $iBlockElement->GetList($orderParams, $filterParams, false, false, $selectParams);
     while ($element = $dbElements->GetNext()) {
         $result[] = $element;
     }
     return $result;
 }
开发者ID:ASDAFF,项目名称:module.markup,代码行数:18,代码来源:CQuetzalMarkupPriceOptionsEdit.php


示例14: addElementReview

function addElementReview($arResult, $ID_SECTION, $IBLOCK_ID)
{
    CModule::IncludeModule('iblock');
    $property_enums = CIBlockPropertyEnum::GetList(array("DEF" => "DESC", "SORT" => "ASC"), array("IBLOCK_ID" => $IBLOCK_ID, "CODE" => "RATING", "VALUE" => $arResult['RATING']));
    while ($rating = $property_enums->GetNext()) {
        $arRating = $rating["ID"];
    }
    $current_date = dateActiveFrom(date('d.m.Y'));
    $NAME = $current_date . ' ' . $arResult['NAME'];
    $arFields = array("ACTIVE" => "N", "IBLOCK_ID" => $IBLOCK_ID, "IBLOCK_SECTION_ID" => $ID_SECTION, "NAME" => $NAME, "DETAIL_TEXT" => "Описание элемента", "PROPERTY_VALUES" => array("NAME" => $arResult['NAME'], "EMAIL" => $arResult['EMAIL'], "RATING" => array('VALUE' => $arRating), "BENEFITS" => $arResult['BENEFITS'], "DISADVANTAGES" => $arResult['DISADVANTAGES'], "COMMENT" => $arResult['COMMENT']));
    $oElement = new CIBlockElement();
    $idElement = $oElement->Add($arFields, false, false, true);
    return $idElement;
}
开发者ID:CheBurashka334,项目名称:zakrepi,代码行数:14,代码来源:add_comment.php


示例15: no_active_stock

/**
 * Выключает прошедшие акции
 * User: Tabota Oleg (sForge.ru)
 * Date: 18.11.12 16:20
 * File name: no_active_stock.php
 */
function no_active_stock()
{
    require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_before.php";
    CModule::IncludeModule("iblock");
    $sort = array("SORT" => "ASC");
    $filter = array("ACTIVE" => "Y", "IBLOCK_ID" => IB_SUB_STOCK_ID, "<DATE_ACTIVE_TO" => date("d.m.Y"));
    $select = array("ID", "IBLOCK_ID");
    $ob = CIBlockElement::GetList($sort, $filter, FALSE, FALSE, $select);
    while ($row = $ob->Fetch()) {
        $el = new CIBlockElement();
        $el->Update(intval($row['ID']), array("ACTIVE" => "N"));
    }
    return "no_active_stock();";
}
开发者ID:nProfessor,项目名称:Mytb,代码行数:20,代码来源:no_active_stock.php


示例16: OnAfterUserAddHandler

function OnAfterUserAddHandler(&$arFields)
{
    if (intval($arFields["ID"]) > 0) {
        global $USER;
        $noticeDefault = array("day" => array(1, 2, 3, 4, 5, 6, 7), "metod" => array("sms", "email"));
        $PROP['USER'] = $arFields["ID"];
        $PROP["NOTICE"] = serialize($noticeDefault);
        $arLoadProductArray = array("MODIFIED_BY" => $USER->GetID(), "IBLOCK_ID" => IB_USER_PROPS, "PROPERTY_VALUES" => $PROP, "NAME" => $arFields["LOGIN"], "ACTIVE" => "Y");
        $el = new CIBlockElement();
        $el->Add($arLoadProductArray);
        return true;
    } else {
        return TRUE;
    }
}
开发者ID:nProfessor,项目名称:Mytb,代码行数:15,代码来源:OnAfterUserAdd.php


示例17: GetElementID

 public static function GetElementID($element_id, $element_code, $section_id, $section_code, $arFilter)
 {
     $element_id = (int) $element_id;
     $element_code = (string) $element_code;
     if ($element_id > 0) {
         return $element_id;
     } elseif ($element_code != '') {
         if (!is_array($arFilter)) {
             $arFilter = array();
         }
         $arFilter['=CODE'] = $element_code;
         $section_id = (int) $section_id;
         $section_code = (string) $section_code;
         if ($section_id > 0) {
             $arFilter['SECTION_ID'] = $section_id;
         } elseif ($section_code != '') {
             $arFilter["SECTION_CODE"] = $section_code;
         }
         $rsElement = CIBlockElement::GetList(array(), $arFilter, false, false, array("ID"));
         if ($arElement = $rsElement->Fetch()) {
             return (int) $arElement["ID"];
         }
     }
     return 0;
 }
开发者ID:Satariall,项目名称:izurit,代码行数:25,代码来源:comp_findtools.php


示例18: getItem

 function getItem()
 {
     $arSelect = array();
     $arFilter = array("IBLOCK_ID" => (int) $GLOBALS['AQW_BRANDS']['IBLOCK_ID'], "ID" => $this->getItemID(), "GLOBAL_ACTIVE" => "Y");
     $res = CIBlockElement::GetList(array("DATE_CREATE" => "DESC"), $arFilter, false, array("nPageSize" => $this->limit), $arSelect);
     return $res->GetNext();
 }
开发者ID:ASDAFF,项目名称:bitrix_marketplace_module,代码行数:7,代码来源:class.php


示例19: getList

 /**
  * Воззвращаем список новостей клуба
  * @return mixed
  */
 function getList($filter = array())
 {
     $filter['IBLOCK_ID'] = IB_SUB_NEWS_ID;
     $filter['PROPERTY_CLUB_ID'] = $this->clubID;
     $ob = CIBlockElement::GetList(array("ACTIVE_FROM" => "DESC"), $filter, false, FALSE, array("ID", "NAME", "ACTIVE_FROM", "DETAIL_TEXT", "PREVIEW_PICTURE"));
     return $ob;
 }
开发者ID:nProfessor,项目名称:Mytb,代码行数:11,代码来源:News.php


示例20: OnProductCatalogHandler

function OnProductCatalogHandler($ID, $arFields)
{
    Bitrix\Main\Loader::includeModule('iblock');
    Bitrix\Main\Loader::includeModule('catalog');
    define('IBLOCK_ID_PRODUCTS', 2);
    define('IBLOCK_ID_OFFERS', 3);
    $query = new \Bitrix\Main\Entity\Query(Bitrix\Iblock\ElementTable::getEntity());
    $query->setSelect(array("ID", "IBLOCK_ID"))->setFilter(array("ID" => $ID))->setOrder(array("ID" => "ASC"));
    $resElement = $query->exec()->fetch();
    if ($resElement['IBLOCK_ID'] == IBLOCK_ID_PRODUCTS) {
        CIBlockElement::SetPropertyValuesEx($ID, $resElement['IBLOCK_ID'], array("AVAILABLE_QUANTITY_CATALOG" => $arFields['QUANTITY']));
    } elseif ($resElement['IBLOCK_ID'] == IBLOCK_ID_OFFERS) {
        //1
        $rsElementOffer = CIBlockElement::GetList(array(), array("ID" => $ID), false, false, array("ID", "IBLOCK_ID", 'NAME', "PROPERTY_CML2_LINK"))->fetch();
        $resElemOfferProduct = (int) $rsElementOffer['PROPERTY_CML2_LINK_VALUE'];
        //2
        $resOffersCML2 = CIBlockElement::GetList(array(), array("PROPERTY_CML2_LINK" => $resElemOfferProduct, 'IBLOCK_ID' => IBLOCK_ID_OFFERS), false, false, array("ID", "IBLOCK_ID", 'NAME'));
        //3
        $arrOffersIDs = array();
        while ($res = $resOffersCML2->fetch()) {
            $arrOffersIDs[] = $res['ID'];
        }
        //4
        $availQuant = array();
        foreach ($arrOffersIDs as $k => $v) {
            $ar_res_cat = CCatalogProduct::GetList(array("ID" => "DESC"), array("ID" => (int) $v), false, false, array("ID", "QUANTITY", 'ELEMENT_IBLOCK_ID', 'ELEMENT_NAME'))->fetch();
            $availQuant[] = $ar_res_cat['QUANTITY'];
        }
        //5
        $minAvailQuant = (int) min($availQuant);
        //6
        $resUpdateSCU = CIBlockElement::SetPropertyValuesEx($resElemOfferProduct, IBLOCK_ID_PRODUCTS, array("AVAILABLE_QUANTITY_CATALOG" => $minAvailQuant));
    }
}
开发者ID:VitaliiSestrenskyi,项目名称:sest,代码行数:34,代码来源:scu_sort_available.php



注:本文中的CIBlockElement类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP CIBlockElementRights类代码示例发布时间:2022-05-23
下一篇:
PHP CIBlock类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap