本文整理汇总了PHP中CIBlock::getFields方法的典型用法代码示例。如果您正苦于以下问题:PHP CIBlock::getFields方法的具体用法?PHP CIBlock::getFields怎么用?PHP CIBlock::getFields使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CIBlock
的用法示例。
在下文中一共展示了CIBlock::getFields方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getIblockFields
/**
* @param int $iblockId
* @return array
*/
public function getIblockFields($iblockId)
{
$return = [];
$cache = $this->getCache();
$cId = get_class($this) . '_fields';
if (!$cache || ($return = $cache->get($cId)) === false) {
$return = [];
$list = $this->getList();
foreach ($list as $ib) {
if (empty($ib['ID'])) {
continue;
}
$return[$ib['ID']] = \CIBlock::getFields($ib['ID']);
}
if ($cache) {
$cache->set($cId, $return, $this->cacheTime);
}
}
return isset($return[$iblockId]) ? $return[$iblockId] : [];
}
示例2: getFields
/**
* Возвращает описание полей инфоблока
* @return array
*/
public static function getFields($iblockId)
{
if (!\CModule::IncludeModule('iblock')) {
return null;
}
if (!isset(self::$_fields[$iblockId])) {
self::$_fields[$iblockId] = \CIBlock::getFields($iblockId);
}
return self::$_fields[$iblockId];
}
示例3: array
}
?>
<a href="<?php
echo $arItem['DETAIL_PAGE_URL'];
?>
">
<?php
$image = $arItem["PREVIEW_PICTURE"];
if (!empty($image)) {
// Пропорциональное уменьшение картинки анонса
$tmpImage = CFile::ResizeImageGet($image, array("width" => 144, "height" => 202), BX_RESIZE_IMAGE_PROPORTIONAL, false);
//Ставим каринку анонса из PREVIEW
$image['src'] = $tmpImage['src'];
} elseif (CModule::IncludeModule('iblock')) {
$Id = $arItem["IBLOCK_ID"];
$fields = CIBlock::getFields($Id);
//Если картинка анонса из детальной
if (!empty($arItem['DETAIL_PICTURE']) && $fields['PREVIEW_PICTURE']['DEFAULT_VALUE']['FROM_DETAIL'] == "Y") {
// Пропорциональное уменьшение картинки анонса
$tmpImage = CFile::ResizeImageGet($arItem['DETAIL_PICTURE'], array("width" => 144, "height" => 202), BX_RESIZE_IMAGE_PROPORTIONAL, false);
//Ставим каринку анонса из детальной
$image['src'] = $tmpImage['src'];
} else {
$image['src'] = $templateFolder . '/images/no_image.png';
}
}
?>
<div class="product_image">
<img src="<?php
echo $image['src'];
示例4: IblockSetFields
/**
* @param string $code
* @param array $fields
*/
protected function IblockSetFields($code, array $fields)
{
$id = $this->IblockGetIdByCode($code);
if ($id) {
$old_fields = \CIBlock::getFields($id);
$fields = array_merge($old_fields, $fields);
\CIBlock::setFields($id, $fields);
} else {
throw new \Exception("Can't set fields for {$code} iblock");
}
}