当前位置: 首页>>代码示例>>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;未经允许,请勿转载。