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


PHP Condition::setupEmpty方法代码示例

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


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

示例1: __getCondition

 /**
  * @param string $value
  * @return Condition
  * @throws \Exception
  * @internal
  */
 public function __getCondition($value)
 {
     if ($this->where === NULL && is_string($this->condition)) {
         list(, $from, $to) = \Nette\Utils\Strings::match($value, $this->mask);
         $from = \DateTime::createFromFormat($this->dateFormatInput, trim($from));
         $to = \DateTime::createFromFormat($this->dateFormatInput, trim($to));
         $values = $from && $to ? array($from->format($this->dateFormatOutput), $to->format($this->dateFormatOutput)) : NULL;
         return $values ? Condition::setup($this->getColumn(), $this->condition, $values) : Condition::setupEmpty();
     }
     return parent::__getCondition($value);
 }
开发者ID:cujan,项目名称:atlashornin,代码行数:17,代码来源:DateRange.php

示例2: __getCondition

 /**
  * @param string $value
  * @return Condition|bool
  * @throws \Exception
  * @internal
  */
 public function __getCondition($value)
 {
     $condition = parent::__getCondition($value);
     if ($condition === NULL) {
         $condition = Condition::setupEmpty();
         if (preg_match('/(<>|[<|>]=?)?([-0-9,|.]+)/', $value, $matches)) {
             $value = str_replace(',', '.', $matches[2]);
             $operator = $matches[1] ? $matches[1] : '=';
             $condition = Condition::setup($this->getColumn(), $operator . ' ?', $value);
         }
     }
     return $condition;
 }
开发者ID:Kaliver,项目名称:grido,代码行数:19,代码来源:Number.php

示例3: __getCondition

 /**
  * @param string $value
  * @return Condition
  * @throws \Exception
  * @internal
  */
 public function __getCondition($value)
 {
     if ($value === '' || $value === NULL) {
         return FALSE;
         //skip
     }
     $condition = $this->getCondition();
     if ($this->where !== NULL) {
         $condition = Condition::setupFromCallback($this->where, $value);
     } else {
         if (is_string($condition)) {
             $condition = Condition::setup($this->getColumn(), $condition, $this->formatValue($value));
         } elseif ($condition instanceof Condition) {
             $condition = $condition;
         } elseif (is_callable($condition)) {
             $condition = callback($condition)->invokeArgs(array($value));
         } elseif (is_array($condition)) {
             $condition = isset($condition[$value]) ? $condition[$value] : Condition::setupEmpty();
         }
     }
     if (is_array($condition)) {
         //for user-defined condition by array or callback
         $condition = Condition::setupFromArray($condition);
     } elseif ($condition !== NULL && !$condition instanceof Condition) {
         $type = gettype($condition);
         throw new \InvalidArgumentException("Condition must be array or Condition object. {$type} given.");
     }
     return $condition;
 }
开发者ID:pepakriz,项目名称:grido,代码行数:35,代码来源:Filter.php

示例4: __getCondition

 /**
  * @param string $value
  * @return Condition
  * @throws \Exception
  * @internal
  */
 public function __getCondition($value)
 {
     if ($this->where === NULL && is_string($this->condition)) {
         return ($date = \DateTime::createFromFormat($this->dateFormatInput, $value)) ? Condition::setupFromArray(array($this->getColumn(), $this->condition, $date->format($this->dateFormatOutput))) : Condition::setupEmpty();
     }
     return parent::__getCondition($value);
 }
开发者ID:cujan,项目名称:atlashornin,代码行数:13,代码来源:Date.php


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