| @@ 172-184 (lines=13) @@ | ||
| 169 | } |
|
| 170 | $metadata->mapManyToOne($mapping); |
|
| 171 | break; |
|
| 172 | case 'oneToMany': |
|
| 173 | $mapping['type'] = EntityMetadata::ONE_TO_MANY; |
|
| 174 | if (array_key_exists('mappedBy', $association)) { |
|
| 175 | $mapping['mappedBy'] = $association['mappedBy']; |
|
| 176 | } |
|
| 177 | if (array_key_exists('orderBy', $association)) { |
|
| 178 | $mapping['orderBy'] = $association['orderBy']; |
|
| 179 | } |
|
| 180 | if (array_key_exists('indexBy', $association)) { |
|
| 181 | $mapping['indexBy'] = $association['indexBy']; |
|
| 182 | } |
|
| 183 | $metadata->mapOneToMany($mapping); |
|
| 184 | break; |
|
| 185 | case 'manyToMany': |
|
| 186 | $mapping['type'] = EntityMetadata::MANY_TO_MANY; |
|
| 187 | if (array_key_exists('apiField', $association)) { |
|
| @@ 185-197 (lines=13) @@ | ||
| 182 | } |
|
| 183 | $metadata->mapOneToMany($mapping); |
|
| 184 | break; |
|
| 185 | case 'manyToMany': |
|
| 186 | $mapping['type'] = EntityMetadata::MANY_TO_MANY; |
|
| 187 | if (array_key_exists('apiField', $association)) { |
|
| 188 | $mapping['apiField'] = $association['apiField']; |
|
| 189 | } |
|
| 190 | if (array_key_exists('orderBy', $association)) { |
|
| 191 | $mapping['orderBy'] = $association['orderBy']; |
|
| 192 | } |
|
| 193 | if (array_key_exists('indexBy', $association)) { |
|
| 194 | $mapping['indexBy'] = $association['indexBy']; |
|
| 195 | } |
|
| 196 | $metadata->mapManyToMany($mapping); |
|
| 197 | break; |
|
| 198 | } |
|
| 199 | } |
|
| 200 | ||