本文整理汇总了PHP中CDBResult::InitFromarray方法的典型用法代码示例。如果您正苦于以下问题:PHP CDBResult::InitFromarray方法的具体用法?PHP CDBResult::InitFromarray怎么用?PHP CDBResult::InitFromarray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDBResult
的用法示例。
在下文中一共展示了CDBResult::InitFromarray方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GetByID
/**
* This method is deprecated. Use CTaskItem class instead.
* @deprecated
*/
public static function GetByID($ID, $bCheckPermissions = true, $arParams = array())
{
$bReturnAsArray = false;
$bSkipExtraData = false;
$arGetListParams = array();
if (isset($arParams['returnAsArray'])) {
$bReturnAsArray = $arParams['returnAsArray'] === true;
}
if (isset($arParams['bSkipExtraData'])) {
$bSkipExtraData = $arParams['bSkipExtraData'] === true;
}
if (isset($arParams['USER_ID'])) {
$arGetListParams['USER_ID'] = $arParams['USER_ID'];
}
$arFilter = array("ID" => (int) $ID);
if (!$bCheckPermissions) {
$arFilter["CHECK_PERMISSIONS"] = "N";
}
$res = CTasks::GetList(array(), $arFilter, array("*", "UF_*"), $arGetListParams);
if ($res && ($task = $res->Fetch())) {
$task["ACCOMPLICES"] = $task["AUDITORS"] = array();
$rsMembers = CTaskMembers::GetList(array(), array("TASK_ID" => $ID));
while ($arMember = $rsMembers->Fetch()) {
if ($arMember["TYPE"] == "A") {
$task["ACCOMPLICES"][] = $arMember["USER_ID"];
} elseif ($arMember["TYPE"] == "U") {
$task["AUDITORS"][] = $arMember["USER_ID"];
}
}
if (!$bSkipExtraData) {
$arTagsFilter = array("TASK_ID" => $ID);
$arTagsOrder = array("NAME" => "ASC");
$rsTags = CTaskTags::GetList($arTagsOrder, $arTagsFilter);
$task["TAGS"] = array();
while ($arTag = $rsTags->Fetch()) {
$task["TAGS"][] = $arTag["NAME"];
}
$rsFiles = CTaskFiles::GetList(array(), array("TASK_ID" => $ID));
$task["FILES"] = array();
while ($arFile = $rsFiles->Fetch()) {
$task["FILES"][] = $arFile["FILE_ID"];
}
$rsDependsOn = CTaskDependence::GetList(array(), array("TASK_ID" => $ID));
$task["DEPENDS_ON"] = array();
while ($arDependsOn = $rsDependsOn->Fetch()) {
$task["DEPENDS_ON"][] = $arDependsOn["DEPENDS_ON_ID"];
}
}
if ($bReturnAsArray) {
return $task;
} else {
$rsTask = new CDBResult();
$rsTask->InitFromarray(array($task));
return $rsTask;
}
} else {
if ($bReturnAsArray) {
return false;
} else {
return $res;
}
}
}