| @@ 116-122 (lines=7) @@ | ||
| 113 | $ret = 'INSERT ' . $this->options; |
|
| 114 | $ret = trim($ret) . ' INTO ' . $this->into; |
|
| 115 | ||
| 116 | if (! is_null($this->values) && count($this->values) > 0) { |
|
| 117 | $ret .= ' VALUES ' . Array2d::build($this->values); |
|
| 118 | } elseif (! is_null($this->set) && count($this->set) > 0) { |
|
| 119 | $ret .= ' SET ' . SetOperation::build($this->set); |
|
| 120 | } elseif (! is_null($this->select) && strlen($this->select) > 0) { |
|
| 121 | $ret .= ' ' . $this->select->build(); |
|
| 122 | } |
|
| 123 | ||
| 124 | if (! is_null($this->onDuplicateSet) && count($this->onDuplicateSet) > 0) { |
|
| 125 | $ret .= ' ON DUPLICATE KEY UPDATE ' . SetOperation::build($this->onDuplicateSet); |
|
| @@ 93-99 (lines=7) @@ | ||
| 90 | $ret = 'REPLACE ' . $this->options; |
|
| 91 | $ret = trim($ret) . ' INTO ' . $this->into; |
|
| 92 | ||
| 93 | if (! is_null($this->values) && count($this->values) > 0) { |
|
| 94 | $ret .= ' VALUES ' . Array2d::build($this->values); |
|
| 95 | } elseif (! is_null($this->set) && count($this->set) > 0) { |
|
| 96 | $ret .= ' SET ' . SetOperation::build($this->set); |
|
| 97 | } elseif (! is_null($this->select) && strlen($this->select) > 0) { |
|
| 98 | $ret .= ' ' . $this->select->build(); |
|
| 99 | } |
|
| 100 | ||
| 101 | return $ret; |
|
| 102 | } |
|