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


PHP DatabaseCompatibilityUtil::getMaxVarCharLength方法代码示例

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


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

示例1: __construct

 public function __construct($modelClassName, $attributeName)
 {
     parent::__construct($modelClassName, $attributeName);
     assert('is_string($attributeName)');
     $this->maxLength = DatabaseCompatibilityUtil::getMaxVarCharLength();
     $this->messageCountData[static::EMAIL_TOO_LONG] = 0;
 }
开发者ID:youprofit,项目名称:Zurmo,代码行数:7,代码来源:EmailBatchAttributeValueDataAnalyzer.php

示例2: sanitizeValue

 /**
  * Given a value, resolve that the value is a correctly formatted url. If not, an
  * InvalidValueToSanitizeException is thrown.
  * @param mixed $value
  * @return sanitized value
  * @throws InvalidValueToSanitizeException
  */
 public function sanitizeValue($value)
 {
     if ($value == null) {
         return $value;
     }
     $maxLength = DatabaseCompatibilityUtil::getMaxVarCharLength();
     if (false === ($validatedUrl = $this->resolveValidatedUrl($value))) {
         throw new InvalidValueToSanitizeException(Zurmo::t('ImportModule', 'Invalid url format.'));
     }
     if (strlen($validatedUrl) > $maxLength) {
         throw new InvalidValueToSanitizeException(Zurmo::t('ImportModule', 'URL was too long.'));
     }
     return $validatedUrl;
 }
开发者ID:maruthisivaprasad,项目名称:zurmo,代码行数:21,代码来源:UrlSanitizerUtil.php

示例3: sanitizeValue

 /**
  * Given a value, resolve that the value is a correctly formatted email address. If not, an
  * InvalidValueToSanitizeException is thrown.
  * @param mixed $value
  * @return sanitized value
  * @throws InvalidValueToSanitizeException
  */
 public function sanitizeValue($value)
 {
     assert('$this->mappingRuleData == null');
     if ($value == null) {
         return $value;
     }
     $maximumLength = DatabaseCompatibilityUtil::getMaxVarCharLength();
     if (false === ($validatedEmail = $this->resolveValidatedEmail($value))) {
         throw new InvalidValueToSanitizeException(Zurmo::t('ImportModule', 'Invalid email format.'));
     }
     if (strlen($validatedEmail) > $maximumLength) {
         throw new InvalidValueToSanitizeException(Zurmo::t('ImportModule', 'Email was too long.'));
     }
     return $value;
 }
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:22,代码来源:EmailSanitizerUtil.php

示例4: sanitizeValue

 /**
  * Given a value, resolve that the value is a correctly formatted email address. If not, an
  * InvalidValueToSanitizeException is thrown.
  * @param string $modelClassName
  * @param string $attributeName
  * @param mixed $value
  * @param array $mappingRuleData
  */
 public static function sanitizeValue($modelClassName, $attributeName, $value, $mappingRuleData)
 {
     assert('is_string($modelClassName)');
     assert('is_string($attributeName)');
     assert('$mappingRuleData == null');
     if ($value == null) {
         return $value;
     }
     $maxLength = DatabaseCompatibilityUtil::getMaxVarCharLength();
     $validator = new CEmailValidator();
     $validatedEmail = $validator->validateValue($value);
     if ($validatedEmail === false) {
         throw new InvalidValueToSanitizeException(Zurmo::t('ImportModule', 'Invalid email format.'));
     }
     if (strlen($validatedEmail) > $maxLength) {
         throw new InvalidValueToSanitizeException(Zurmo::t('ImportModule', 'Email was too long.'));
     }
     return $value;
 }
开发者ID:sandeep1027,项目名称:zurmo_,代码行数:27,代码来源:EmailSanitizerUtil.php

示例5: testGetMaxVarCharLength

 public function testGetMaxVarCharLength()
 {
     $this->assertEquals(255, DatabaseCompatibilityUtil::getMaxVarCharLength());
 }
开发者ID:youprofit,项目名称:Zurmo,代码行数:4,代码来源:DatabaseCompatibilityUtilTest.php


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