本文整理汇总了PHP中CUserTypeEntity::getList方法的典型用法代码示例。如果您正苦于以下问题:PHP CUserTypeEntity::getList方法的具体用法?PHP CUserTypeEntity::getList怎么用?PHP CUserTypeEntity::getList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CUserTypeEntity
的用法示例。
在下文中一共展示了CUserTypeEntity::getList方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: installDiskUserFields
public static function installDiskUserFields()
{
global $APPLICATION;
$errors = null;
if(!IsModuleInstalled('disk'))
{
return;
}
$props = array(
array(
"ENTITY_ID" => "BLOG_POST",
"FIELD_NAME" => "UF_BLOG_POST_FILE",
"USER_TYPE_ID" => "disk_file"
),
array(
"ENTITY_ID" => "BLOG_COMMENT",
"FIELD_NAME" => "UF_BLOG_COMMENT_FILE",
"USER_TYPE_ID" => "disk_file"
),
array(
"ENTITY_ID" => "BLOG_COMMENT",
"FIELD_NAME" => "UF_BLOG_COMMENT_FH",
"USER_TYPE_ID" => "disk_version"
),
);
$uf = new CUserTypeEntity;
foreach ($props as $prop)
{
$rsData = CUserTypeEntity::getList(array("ID" => "ASC"), array("ENTITY_ID" => $prop["ENTITY_ID"], "FIELD_NAME" => $prop["FIELD_NAME"]));
if (!($rsData && ($arRes = $rsData->Fetch())))
{
$intID = $uf->add(array(
"ENTITY_ID" => $prop["ENTITY_ID"],
"FIELD_NAME" => $prop["FIELD_NAME"],
"XML_ID" => $prop["FIELD_NAME"],
"USER_TYPE_ID" => $prop["USER_TYPE_ID"],
"SORT" => 100,
"MULTIPLE" => ($prop["USER_TYPE_ID"] == "disk_version" ? "N" : "Y"),
"MANDATORY" => "N",
"SHOW_FILTER" => "N",
"SHOW_IN_LIST" => "N",
"EDIT_IN_LIST" => "Y",
"IS_SEARCHABLE" => "N"
), false);
if (false == $intID && ($strEx = $APPLICATION->getException()))
{
$errors[] = $strEx->getString();
}
}
}
return $errors;
}
示例2: InstallUserFields
function InstallUserFields($id = "all")
{
global $APPLICATION;
$errors = null;
$id = in_array($id, array("all", "webdav", "disk")) ? $id : false;
if (!!$id && IsModuleInstalled("webdav")) {
$arFields = array("ENTITY_ID" => "FORUM_MESSAGE", "FIELD_NAME" => "UF_FORUM_MESSAGE_DOC", "XML_ID" => "UF_FORUM_MESSAGE_DOC", "USER_TYPE_ID" => "webdav_element", "SORT" => 100, "MULTIPLE" => "Y", "MANDATORY" => "N", "SHOW_FILTER" => "N", "SHOW_IN_LIST" => "N", "EDIT_IN_LIST" => "Y", "IS_SEARCHABLE" => "N");
$rsData = CUserTypeEntity::GetList(array("ID" => "ASC"), array("ENTITY_ID" => "FORUM_MESSAGE", "FIELD_NAME" => "UF_FORUM_MESSAGE_DOCUMENT"));
if (!($rsData && ($arRes = $rsData->Fetch()))) {
$obUserField = new CUserTypeEntity();
$intID = $obUserField->Add($arFields, false);
if (false == $intID) {
if ($strEx = $GLOBALS['APPLICATION']->GetException()) {
$errors = $strEx->GetString();
}
}
}
}
if (($id == 'all' || $id == 'disk') && IsModuleInstalled("disk")) {
$props = array(array("ENTITY_ID" => "FORUM_MESSAGE", "FIELD_NAME" => "UF_FORUM_MESSAGE_DOC", "USER_TYPE_ID" => "disk_file"), array("ENTITY_ID" => "FORUM_MESSAGE", "FIELD_NAME" => "UF_FORUM_MESSAGE_VER", "USER_TYPE_ID" => "disk_version"));
$uf = new CUserTypeEntity();
foreach ($props as $prop) {
$rsData = CUserTypeEntity::getList(array("ID" => "ASC"), array("ENTITY_ID" => $prop["ENTITY_ID"], "FIELD_NAME" => $prop["FIELD_NAME"]));
if (!($rsData && ($arRes = $rsData->Fetch()))) {
$intID = $uf->add(array("ENTITY_ID" => $prop["ENTITY_ID"], "FIELD_NAME" => $prop["FIELD_NAME"], "XML_ID" => $prop["FIELD_NAME"], "USER_TYPE_ID" => $prop["USER_TYPE_ID"], "SORT" => 100, "MULTIPLE" => $prop["USER_TYPE_ID"] == "disk_version" ? "N" : "Y", "MANDATORY" => "N", "SHOW_FILTER" => "N", "SHOW_IN_LIST" => "N", "EDIT_IN_LIST" => "Y", "IS_SEARCHABLE" => $prop["USER_TYPE_ID"] == "disk_file" ? "Y" : "N"), false);
if (false == $intID && ($strEx = $APPLICATION->getException())) {
$errors = $strEx->getString();
}
}
}
}
return $errors;
}
示例3: InstallUserFields
function InstallUserFields($id = "all")
{
global $APPLICATION;
$errors = null;
if (($id == 'all' || $id == 'disk') && IsModuleInstalled('disk')) {
$uf = new CUserTypeEntity();
$rsData = CUserTypeEntity::getList(array("ID" => "ASC"), array("ENTITY_ID" => 'CALENDAR_EVENT', "FIELD_NAME" => 'UF_WEBDAV_CAL_EVENT'));
if (!($rsData && ($arRes = $rsData->Fetch()))) {
$intID = $uf->add(array("ENTITY_ID" => 'CALENDAR_EVENT', "FIELD_NAME" => 'UF_WEBDAV_CAL_EVENT', "XML_ID" => 'UF_WEBDAV_CAL_EVENT', "USER_TYPE_ID" => 'disk_file', "SORT" => 100, "MULTIPLE" => "Y", "MANDATORY" => "N", "SHOW_FILTER" => "N", "SHOW_IN_LIST" => "N", "EDIT_IN_LIST" => "Y", "IS_SEARCHABLE" => "Y"), false);
if (false == $intID && ($strEx = $APPLICATION->getException())) {
$errors[] = $strEx->getString();
}
}
}
if (($id == 'all' || $id == 'webdav') && IsModuleInstalled('webdav')) {
$ENTITY_ID = 'CALENDAR_EVENT';
$FIELD_NAME = 'UF_WEBDAV_CAL_EVENT';
$arElement = $GLOBALS['USER_FIELD_MANAGER']->GetUserFields($ENTITY_ID, 0);
if (empty($arElement) || $arElement == array() || $arElement == false || !isset($arElement[$FIELD_NAME])) {
$arFields = array("ENTITY_ID" => $ENTITY_ID, "FIELD_NAME" => $FIELD_NAME, "XML_ID" => $FIELD_NAME, "USER_TYPE_ID" => "webdav_element", "SORT" => 100, "MULTIPLE" => "Y", "MANDATORY" => "N", "SHOW_FILTER" => "N", "SHOW_IN_LIST" => "N", "EDIT_IN_LIST" => "Y", "IS_SEARCHABLE" => "N");
$obUserField = new CUserTypeEntity();
$intID = $obUserField->Add($arFields, false);
if (false == $intID) {
if ($strEx = $APPLICATION->GetException()) {
$errors[] = $strEx->GetString();
}
}
}
}
return $errors;
}
示例4: installDiskUserFields
public static function installDiskUserFields()
{
global $APPLICATION;
$errors = null;
if (!IsModuleInstalled('disk')) {
return $errors;
}
$uf = new CUserTypeEntity();
$rsData = CUserTypeEntity::getList(array("ID" => "ASC"), array("ENTITY_ID" => 'TASKS_TASK', "FIELD_NAME" => 'UF_TASK_WEBDAV_FILES'));
if (!($rsData && ($arRes = $rsData->Fetch()))) {
$intID = $uf->add(array('ENTITY_ID' => 'TASKS_TASK', 'FIELD_NAME' => 'UF_TASK_WEBDAV_FILES', 'USER_TYPE_ID' => 'disk_file', 'XML_ID' => 'TASK_WEBDAV_FILES', 'MULTIPLE' => 'Y', 'MANDATORY' => null, 'SHOW_FILTER' => 'N', 'SHOW_IN_LIST' => null, 'EDIT_IN_LIST' => null, 'IS_SEARCHABLE' => 'Y', 'EDIT_FORM_LABEL' => array('en' => 'Load files', 'ru' => 'Load files', 'de' => 'Load files')), false);
if (false == $intID && ($strEx = $APPLICATION->getException())) {
$errors[] = $strEx->getString();
}
}
return $errors;
}