| @@ 153-162 (lines=10) @@ | ||
| 150 | * |
|
| 151 | * @return ClassMetadataBuilder |
|
| 152 | */ |
|
| 153 | public function addIndex(array $columns, $name) |
|
| 154 | { |
|
| 155 | if (!isset($this->cm->table['indexes'])) { |
|
| 156 | $this->cm->table['indexes'] = []; |
|
| 157 | } |
|
| 158 | ||
| 159 | $this->cm->table['indexes'][$name] = ['columns' => $columns]; |
|
| 160 | ||
| 161 | return $this; |
|
| 162 | } |
|
| 163 | ||
| 164 | /** |
|
| 165 | * Adds Unique Constraint. |
|
| @@ 172-181 (lines=10) @@ | ||
| 169 | * |
|
| 170 | * @return ClassMetadataBuilder |
|
| 171 | */ |
|
| 172 | public function addUniqueConstraint(array $columns, $name) |
|
| 173 | { |
|
| 174 | if ( ! isset($this->cm->table['uniqueConstraints'])) { |
|
| 175 | $this->cm->table['uniqueConstraints'] = []; |
|
| 176 | } |
|
| 177 | ||
| 178 | $this->cm->table['uniqueConstraints'][$name] = ['columns' => $columns]; |
|
| 179 | ||
| 180 | return $this; |
|
| 181 | } |
|
| 182 | ||
| 183 | /** |
|
| 184 | * Adds named query. |
|