当前位置: 首页>>代码示例>>PHP>>正文


PHP CFile::GetById方法代码示例

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


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

示例1: __construct

 /**
  * File constructor.
  * @param $id
  */
 public function __construct($id)
 {
     $res = \CFile::GetById($id);
     while ($row = $res->Fetch()) {
         $this->fieldsData = $row;
         $this->id = $id;
         break;
     }
 }
开发者ID:techart,项目名称:bitrix.tao,代码行数:13,代码来源:file.php

示例2: IncludeTemplateLangFile

<?php 
global $USER;
$user_id = $USER->GetID();
if (!$user_id) {
    return;
}
if (!CModule::IncludeModule('st1234holes')) {
    return;
}
IncludeTemplateLangFile(__FILE__);
$_user = $USER->GetByID($user_id);
$_user = $_user->Fetch();
if ($_user['PERSONAL_PHOTO']) {
    $_user['PERSONAL_PHOTO'] = CFile::GetById($_user['PERSONAL_PHOTO']);
    $_user['PERSONAL_PHOTO'] = $_user['PERSONAL_PHOTO']->Fetch();
}
$_user_holes = C1234Hole::GetList(array(), array('USER_ID' => $user_id), array('nopicts' => true));
$fixed = 0;
$holes = 0;
global $fresh;
$fresh = 0;
foreach ($_user_holes as $hole) {
    $holes++;
    if ($hole['STATE'] == 'fixed') {
        $fixed++;
    }
    if ($hole['STATE'] == 'fresh') {
        $fresh++;
    }
}
$holes = (string) $holes;
开发者ID:RosYama,项目名称:rosyama.ru,代码行数:31,代码来源:personal_data.php

示例3: GetMessage

        $arResult['HOLE']['PAST_DAYS'] .= ' ' . GetMessage('DAYS5');
    } elseif ($last_digit > 4 || !$last_digit) {
        $arResult['HOLE']['PAST_DAYS'] .= ' ' . GetMessage('DAYS5');
    } elseif ($last_digit > 1) {
        $arResult['HOLE']['PAST_DAYS'] .= ' ' . GetMessage('DAYS2');
    } else {
        $arResult['HOLE']['PAST_DAYS'] .= ' ' . GetMessage('DAY');
    }
} elseif ($arResult['HOLE']['STATE'] == 'fixed') {
    $arResult['allow_cancel_fix'] = sizeof($arResult['HOLE']['pictures']['original']['fixed']) ? false : true;
}
$arResult['PROSECUTOR_FORM_TO'] = CGreensightRFSubject::$_RF_SUBJECTS_GENITIVE[$arResult['HOLE']['ADR_SUBJECTRF']];
$arResult['AUTHOR'] = CUser::GetByID($arResult['HOLE']['USER_ID']);
$arResult['AUTHOR'] = $arResult['AUTHOR']->Fetch();
if ($arResult['AUTHOR']['PERSONAL_PHOTO']) {
    $arResult['AUTHOR']['PERSONAL_PHOTO'] = CFile::GetById($arResult['AUTHOR']['PERSONAL_PHOTO']);
    $arResult['AUTHOR']['PERSONAL_PHOTO'] = $arResult['AUTHOR']['PERSONAL_PHOTO']->Fetch();
}
$arResult['YANDEX_MAP_KEY'] = CIBlockPropertyMapYandex::_GetMapKey('yandex', $_SERVER['SERVER_NAME']);
// начальник и отделение ГИБДД, а также прокуратура
if ($arResult['HOLE']['ADR_SUBJECTRF']) {
    $res = CIBlockElement::GetList(array(), array('IBLOCK_CODE' => 'GIBDD_HEADS', 'PROPERTY_SUBJECT_ID' => $arResult['HOLE']['ADR_SUBJECTRF']), array('PROPERTY_POST_DATIVE', 'PROPERTY_FIO_DATIVE', 'PROPERTY_POST'));
    $ar = $res->Fetch();
    $arResult['PDF_FORM_TO'] = $ar['PROPERTY_POST_DATIVE_VALUE'] . ' ' . $ar['PROPERTY_FIO_DATIVE_VALUE'];
    $arResult['PROSECUTOR_GIBDD'] = explode(' ', $ar['PROPERTY_POST_VALUE']);
    $arResult['PROSECUTOR_GIBDD'] = array_slice($arResult['PROSECUTOR_GIBDD'], 1);
    if (ToUpper($arResult['PROSECUTOR_GIBDD'][0]) == 'УПРАВЛЕНИЯ') {
        $arResult['PROSECUTOR_GIBDD'][0] = 'УПРАВЛЕНИЕ';
    }
    $arResult['PROSECUTOR_GIBDD'] = implode(' ', $arResult['PROSECUTOR_GIBDD']);
    $res = CIBlockElement::GetList(array(), array('IBLOCK_CODE' => 'PROSECUTORS', 'PROPERTY_SUBJECT_ID' => $arResult['HOLE']['ADR_SUBJECTRF']));
开发者ID:RosYama,项目名称:rosyama.ru,代码行数:31,代码来源:component.php


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