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


PHP BizSystem::typeManager方法代码示例

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


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

示例1: setInputRecord

 /**
  * Assign a record array as the internal record of the {@link BizRecord}
  *
  * @param array $inpuArr
  * @return void
  */
 public final function setInputRecord(&$inputArr)
 {
     // unformat the inputs
     unset($this->m_InputFields);
     foreach ($inputArr as $key => $value) {
         // if allow changing key field, need to keep the old value which is also useful for audit trail
         // if (!$value)
         //    continue;
         $bizField = $this->m_var[$key];
         if (!$bizField) {
             continue;
         }
         $realVal = BizSystem::typeManager()->formattedStringToValue($bizField->m_Type, $bizField->m_Format, $value);
         if (strtoupper($bizField->m_Encrypted) == 'Y') {
             $svcobj = BizSystem::getService(CRYPT_SERVICE);
             $realVal = $svcobj->encrypt($realVal);
             $bizField->setValue($realVal);
         }
         // todo: need to optimize on lob column
         $bizField->setValue($realVal);
         $this->m_InputFields[] = $key;
     }
     //$this->m_var["Id"]->setValue($this->getKeyValue());
 }
开发者ID:que273,项目名称:siremis,代码行数:30,代码来源:BizRecord.php

示例2: inputValToRule

/**
 * Convert the user input on a given fieldcontrol in query mode to search rule
 *
 * @param string $fieldName - fieldcontrol name
 * @param string $inputVal - use input text
 * @param EasyForm $formObj
 * @return string - searchRule
 */
function inputValToRule($fieldName, $inputVal, $formObj)
{
    // todo: should check single quote for nonoperators clauses
    // find locations for all sql key words
    // search for starting ' and closing ' pair, check if sql key word in the pair
    $val = strtoupper(trim($inputVal));
    // check " AND ", " OR "
    if (($pos = strpos($val, " AND ")) !== false) {
        $inputArr = explode(" AND ", $val);
        $retStr = null;
        foreach ($inputArr as $v) {
            $retStr .= $retStr ? " AND " . inputValToRule($fieldName, $v, $formObj) : inputValToRule($fieldName, $v, $formObj);
        }
        return $retStr;
    } else {
        if (($pos = strpos($val, " OR ")) !== false) {
            $inputArr = explode(" OR ", $val);
            $retStr = null;
            foreach ($inputArr as $v) {
                $retStr .= $retStr ? " OR " . inputValToRule($fieldName, $v, $formObj) : inputValToRule($fieldName, $v, $formObj);
            }
            return "(" . $retStr . ")";
        }
    }
    // check >=, >, <=, <, =
    if (($pos = strpos($val, "<>")) !== false || ($pos = strpos($val, "!=")) !== false) {
        $opr = "<>";
        $oprlen = 2;
    } else {
        if (($pos = strpos($val, ">=")) !== false) {
            $opr = ">=";
            $oprlen = 2;
        } else {
            if (($pos = strpos($val, ">")) !== false) {
                $opr = ">";
                $oprlen = 1;
            } else {
                if (($pos = strpos($val, "<=")) !== false) {
                    $opr = "<=";
                    $oprlen = 2;
                } else {
                    if (($pos = strpos($val, "<")) !== false) {
                        $opr = "<";
                        $oprlen = 1;
                    } else {
                        if (($pos = strpos($val, "=")) !== false) {
                            $opr = "=";
                            $oprlen = 1;
                        }
                    }
                }
            }
        }
    }
    if ($opr) {
        $val = trim(substr($val, $pos + $oprlen));
    }
    if (strpos($val, "*") !== false) {
        $opr = "LIKE";
        $val = str_replace("*", "%", $val);
    }
    //if (strpos($val, "'") !== false) {   // not needed since addslashes() is called before
    //   $val = str_replace("'", "\\'", $val);
    //}
    if (!$opr) {
        $opr = "=";
    }
    // unformat value to real value data
    if ($formObj->getDataObj()) {
        $bizField = $formObj->getDataObj()->getField($fieldName);
        $realValue = BizSystem::typeManager()->formattedStringToValue($bizField->m_Type, $bizField->m_Format, $val);
    } else {
        $realValue = $val;
    }
    // set the query param
    $queryString = QueryStringParam::formatQueryString("[{$fieldName}]", $opr, $realValue);
    return $queryString;
    //return "[" . $field . "] " . $opr . " '" . $realVal . "'";
}
开发者ID:Why-Not-Sky,项目名称:cubi-ng,代码行数:87,代码来源:SearchHelper.php

示例3: getValue

 /**
  * Get the value of the field.
  *
  * @param boolean $formatted true if want to get the formatted value
  * @return mixed string or number depending on the field type
  */
 public function getValue($formatted = true)
 {
     // need to ensure that value are retrieved from source/cache
     //if ($this->getDataObj()->CheckDataRetrieved() == false)
     //$this->getDataObj()->getActiveRecord();
     if ($this->_prevValue == $this->m_Value) {
         return $this->_getValueCache;
     }
     $value = stripcslashes($this->m_Value);
     $value = $this->m_Value;
     if ($this->m_ValueExpression && trim($this->m_Column) == "") {
         $value = Expression::evaluateExpression($this->m_ValueExpression, $this->getDataObj());
     }
     if ($this->m_Format && $formatted) {
         $value = BizSystem::typeManager()->valueToFormattedString($this->m_Type, $this->m_Format, $value);
     }
     $this->_prevValue = $this->m_Value;
     $this->_getValueCache = $value;
     return $value;
 }
开发者ID:Why-Not-Sky,项目名称:cubi-ng,代码行数:26,代码来源:BizField.php


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