當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ArrayUtils::join方法代碼示例

本文整理匯總了PHP中ArrayUtils::join方法的典型用法代碼示例。如果您正苦於以下問題:PHP ArrayUtils::join方法的具體用法?PHP ArrayUtils::join怎麽用?PHP ArrayUtils::join使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ArrayUtils的用法示例。


在下文中一共展示了ArrayUtils::join方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __sql_conditions

 protected function __sql_conditions()
 {
     $first = true;
     foreach ($this->conditions as $kv) {
         if ($first) {
             $this->sql .= " WHERE ";
         } else {
             $this->sql .= " AND ";
         }
         if ($kv["type"] == self::CONDITION_MATCH_AGAINST) {
             $this->__sql_field_match_against($kv);
         } else {
             $this->sql .= "`" . $kv["field"] . "`";
             if ($kv["inner_statement"]) {
                 $this->sql .= " IN ";
             } else {
                 if ($kv["type"] == self::CONDITION_CONTAINS || $kv["type"] == self::CONDITION_BEGIN_WITH || $kv["type"] == self::CONDITION_END_WITH) {
                     if ($kv["not"]) {
                         $this->sql .= " NOT";
                     }
                     $this->sql .= " LIKE ";
                 }
                 if ($kv["type"] == self::CONDITION_REGEXP) {
                     if ($kv["not"]) {
                         $this->sql .= " NOT";
                     }
                     $this->sql .= " REGEXP ";
                     if ($kv["binary"]) {
                         $this->sql .= "BINARY ";
                     }
                 }
                 if ($kv["type"] == self::CONDITION_TYPE_EQUALS) {
                     $this->sql .= " = ";
                 }
                 if ($kv["type"] == self::CONDITION_TYPE_NOT_EQUALS) {
                     $this->sql .= " != ";
                 }
                 if ($kv["type"] == self::CONDITION_TYPE_GREATER_THAN) {
                     $this->sql .= " > ";
                 }
                 if ($kv["type"] == self::CONDITION_TYPE_GREATER_THAN_OR_EQUAL) {
                     $this->sql .= " >= ";
                 }
                 if ($kv["type"] == self::CONDITION_TYPE_LESS_THAN) {
                     $this->sql .= " < ";
                 }
                 if ($kv["type"] == self::CONDITION_TYPE_LESS_THAN_OR_EQUAL) {
                     $this->sql .= " <= ";
                 }
                 if ($kv["type"] == self::CONDITION_TYPE_IN) {
                     $this->sql .= " IN ";
                 }
                 if ($kv["type"] == self::CONDITION_TYPE_NOT_IN) {
                     $this->sql .= " NOT IN ";
                 }
             }
             if ($kv["inner_statement"]) {
                 $this->sql .= "(";
             }
             if ($kv["quote"]) {
                 $this->sql .= "'";
             }
             if ($kv["type"] == self::CONDITION_TYPE_IN || $kv["type"] == self::CONDITION_TYPE_NOT_IN) {
                 $this->sql .= " (" . ArrayUtils::join($kv["values"], ",") . ")";
             } else {
                 if ($kv["type"] == self::CONDITION_BEGIN_WITH || $kv["type"] == self::CONDITION_CONTAINS) {
                     $this->sql .= "%";
                 }
                 $this->sql .= $kv["value"];
                 if ($kv["type"] == self::CONDITION_CONTAINS || $kv["type"] == self::CONDITION_END_WITH) {
                     $this->sql .= "%";
                 }
             }
             if ($kv["quote"]) {
                 $this->sql .= "'";
             }
             if ($kv["inner_statement"]) {
                 $this->sql .= ")";
             }
         }
         $first = false;
     }
 }
開發者ID:mbcraft,項目名稱:frozen,代碼行數:83,代碼來源:__AbstractMysql.class.php


注:本文中的ArrayUtils::join方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。