| @@ 81-103 (lines=23) @@ | ||
| 78 | * |
|
| 79 | * @return array |
|
| 80 | */ |
|
| 81 | public function getDeleteTableJoin( |
|
| 82 | TableNodeInterface $source, |
|
| 83 | TableNodeInterface $join, |
|
| 84 | $on, |
|
| 85 | $where = null |
|
| 86 | ) { |
|
| 87 | return [ |
|
| 88 | $this->format( |
|
| 89 | 'DELETE {source:schema|q}.{source:table|q} |
|
| 90 | FROM {source:schema|q}.{source:table|q} |
|
| 91 | JOIN {join:schema|q}.{join:table|q} |
|
| 92 | ON {on} |
|
| 93 | {where}', |
|
| 94 | [ |
|
| 95 | 'source' => $source, |
|
| 96 | 'join' => $join, |
|
| 97 | 'on' => $on, |
|
| 98 | 'where' => ($where ? 'WHERE ' . $where : ''), |
|
| 99 | ] |
|
| 100 | ), |
|
| 101 | [], |
|
| 102 | ]; |
|
| 103 | } |
|
| 104 | ||
| 105 | /** |
|
| 106 | * @param TableNodeInterface $table |
|
| @@ 112-136 (lines=25) @@ | ||
| 109 | * |
|
| 110 | * @return array [sql, bind] |
|
| 111 | */ |
|
| 112 | public function getDeleteTableJoin( |
|
| 113 | TableNodeInterface $source, |
|
| 114 | TableNodeInterface $join, |
|
| 115 | $on, |
|
| 116 | $where = null |
|
| 117 | ) { |
|
| 118 | return [ |
|
| 119 | $this->format( |
|
| 120 | 'DELETE FROM |
|
| 121 | {source:schema|q}.{source:table|q} |
|
| 122 | USING |
|
| 123 | {join:schema|q}.{join:table|q} |
|
| 124 | WHERE |
|
| 125 | {on} |
|
| 126 | {where}', |
|
| 127 | [ |
|
| 128 | 'source' => $source, |
|
| 129 | 'join' => $join, |
|
| 130 | 'on' => $on, |
|
| 131 | 'where' => ($where ? sprintf('AND (%s)', $where) : ''), |
|
| 132 | ] |
|
| 133 | ), |
|
| 134 | [], |
|
| 135 | ]; |
|
| 136 | } |
|
| 137 | ||
| 138 | /** |
|
| 139 | * @param TableNodeInterface $table |
|