本文整理汇总了PHP中CSaleStatus::statusFields方法的典型用法代码示例。如果您正苦于以下问题:PHP CSaleStatus::statusFields方法的具体用法?PHP CSaleStatus::statusFields怎么用?PHP CSaleStatus::statusFields使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSaleStatus
的用法示例。
在下文中一共展示了CSaleStatus::statusFields方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: CheckFields
public static function CheckFields($ACTION, &$arFields, $statusId = '')
{
if ((is_set($arFields, "SORT") || $ACTION == "ADD") && IntVal($arFields["SORT"]) <= 0) {
$arFields["SORT"] = 100;
}
if ((is_set($arFields, "ID") || $ACTION == "ADD") && strlen($arFields["ID"]) <= 0) {
return false;
}
if (is_set($arFields, "ID") && strlen($statusId) > 0 && $statusId != $arFields["ID"]) {
return false;
}
if (is_set($arFields, "ID") && !preg_match("#[A-Za-z]#i", $arFields["ID"]) || strlen($statusId) > 0 && !preg_match("#[A-Za-z]#i", $statusId)) {
$GLOBALS["APPLICATION"]->ThrowException(Loc::getMessage("SKGS_ID_NOT_SYMBOL"), "ERROR_ID_NOT_SYMBOL");
return false;
}
$result = new Result();
if (!self::$statusFields) {
self::$statusFields = StatusTable::getEntity()->getScalarFields();
self::$langFields = StatusLangTable::getEntity()->getScalarFields();
self::$taskFields = StatusGroupTaskTable::getEntity()->getScalarFields();
}
switch ($ACTION) {
case 'ADD':
$statusId = $arFields['ID'];
StatusTable::checkFields($result, null, array_intersect_key($arFields, self::$statusFields));
break;
case 'UPDATE':
StatusTable::checkFields($result, $statusId, array_intersect_key(array_diff_key($arFields, array('ID' => 1)), self::$statusFields));
break;
default:
throw new SystemException('Invalid action: ' . $ACTION, 0, __FILE__, __LINE__);
}
if (isset($arFields['LANG']) && is_array($arFields['LANG']) && !empty($arFields['LANG'])) {
$availableLanguages = array_map('current', LanguageTable::getList(array('select' => array('LID'), 'filter' => array('=ACTIVE' => 'Y')))->fetchAll());
foreach ($arFields['LANG'] as $data) {
if ($data['NAME'] && in_array($data['LID'], $availableLanguages)) {
StatusLangTable::checkFields($result, null, array('STATUS_ID' => $statusId) + array_intersect_key($data, self::$langFields));
} else {
return false;
}
}
}
return $result->isSuccess();
}