| @@ 173-185 (lines=13) @@ | ||
| 170 | foreach (array_keys($contentIds) as $destinationContentId) { |
|
| 171 | if (isset($mappedRelations[$relationType][$fieldDefinitionId][$destinationContentId])) { |
|
| 172 | unset($mappedRelations[$relationType][$fieldDefinitionId][$destinationContentId]); |
|
| 173 | } else { |
|
| 174 | $this->persistenceHandler->contentHandler()->addRelation( |
|
| 175 | new SPIRelationCreateStruct( |
|
| 176 | array( |
|
| 177 | 'sourceContentId' => $sourceContentId, |
|
| 178 | 'sourceContentVersionNo' => $sourceContentVersionNo, |
|
| 179 | 'sourceFieldDefinitionId' => $fieldDefinitionId, |
|
| 180 | 'destinationContentId' => $destinationContentId, |
|
| 181 | 'type' => $relationType, |
|
| 182 | ) |
|
| 183 | ) |
|
| 184 | ); |
|
| 185 | } |
|
| 186 | } |
|
| 187 | } |
|
| 188 | } elseif ($relationType === Relation::LINK || $relationType === Relation::EMBED) { |
|
| @@ 192-204 (lines=13) @@ | ||
| 189 | foreach (array_keys($relationData) as $destinationContentId) { |
|
| 190 | if (isset($mappedRelations[$relationType][$destinationContentId])) { |
|
| 191 | unset($mappedRelations[$relationType][$destinationContentId]); |
|
| 192 | } else { |
|
| 193 | $this->persistenceHandler->contentHandler()->addRelation( |
|
| 194 | new SPIRelationCreateStruct( |
|
| 195 | array( |
|
| 196 | 'sourceContentId' => $sourceContentId, |
|
| 197 | 'sourceContentVersionNo' => $sourceContentVersionNo, |
|
| 198 | 'sourceFieldDefinitionId' => null, |
|
| 199 | 'destinationContentId' => $destinationContentId, |
|
| 200 | 'type' => $relationType, |
|
| 201 | ) |
|
| 202 | ) |
|
| 203 | ); |
|
| 204 | } |
|
| 205 | } |
|
| 206 | } |
|
| 207 | } |
|