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


PHP Condition::getCondition方法代码示例

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


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

示例1: extractTypeInfos

 /**
  * gets a doc comment block as string and tries to extract type information
  * from it, storing in the param info array given.
  *
  * Looks for doc comments like "@param <type> <varname> ....".
  */
 protected function extractTypeInfos($docComment, &$paramInfo)
 {
     $matches = $this->matchParams($docComment);
     foreach ($matches['varname'] as $key => $varname) {
         if (!empty($matches['type'][$key]) && isset($paramInfo[$varname])) {
             $paramInfo[$varname]['type'] = $matches['type'][$key];
             $conditionStr = !empty($matches['condition'][$key]) ? $matches['condition'][$key] : null;
             if ($conditionStr) {
                 $cond = Condition::getCondition($paramInfo[$varname]['type'], $conditionStr);
                 $paramInfo[$varname]['condition'] = $cond;
             }
         }
     }
 }
开发者ID:bylexus,项目名称:php-injector,代码行数:20,代码来源:Injector.php

示例2: selectDesc

 /**
  * @param Condition $_condition
  * @return array
  */
 public function selectDesc(Condition $_condition)
 {
     /* ## LOGGER ## */
     if (isset($this->logger)) {
         $this->logger->DEBUG('select: ' . $_condition->toString());
     }
     if (empty($_condition)) {
         throw new UndefinedRowException('null');
     }
     $table = $this->connection->escape($this->table);
     $primary = $this->connection->escape($this->primary);
     $key = $this->connection->escape($_condition->getKey());
     $value = $this->connection->escape($_condition->getValue());
     $condition = $this->connection->escape($_condition->getCondition());
     $sql = 'SELECT * FROM `' . $table . '` WHERE `' . $key . '` ' . $_condition . ' \'' . $value . '\' ORDER BY `' . $primary . '` DESC;';
     $result = $this->connection->send($sql);
     if (mysql_num_rows($result) < 0) {
         throw new UndefinedRowException('undefined ' . $key . ' ' . $_condition . ' ' . $value);
     }
     $values = array();
     while ($value = mysql_fetch_assoc($result)) {
         $values[] = $value;
     }
     return $values;
 }
开发者ID:keil,项目名称:phpDBI-MySQL-Database-Interface-,代码行数:29,代码来源:Table.class.php


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