本文整理汇总了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;
}
}