當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。