|
@@ 255-261 (lines=7) @@
|
| 252 |
|
|
| 253 |
|
case Document::RELATION_MANY_MANY: |
| 254 |
|
$isRelationListStoredInternally = isset($relation[3]) && $relation[3]; |
| 255 |
|
if ($isRelationListStoredInternally) { |
| 256 |
|
$documentDbRef = self::generateMongoDBRef($document); |
| 257 |
|
$this->document->push($field, $documentDbRef)->save(); |
| 258 |
|
} else { |
| 259 |
|
$documentDbRef = self::generateMongoDBRef($this->document); |
| 260 |
|
$document->push($field, $documentDbRef)->save(); |
| 261 |
|
} |
| 262 |
|
break; |
| 263 |
|
|
| 264 |
|
default: |
|
@@ 320-326 (lines=7) @@
|
| 317 |
|
throw new \Sokil\Mongo\Exception('Related document must be defined'); |
| 318 |
|
} |
| 319 |
|
$isRelationListStoredInternally = isset($relation[3]) && $relation[3]; |
| 320 |
|
if ($isRelationListStoredInternally) { |
| 321 |
|
$documentDbRef = self::generateDbRef($document, true); |
| 322 |
|
$this->document->pull($field, $documentDbRef)->save(); |
| 323 |
|
} else { |
| 324 |
|
$documentDbRef = self::generateDbRef($this->document, true); |
| 325 |
|
$document->pull($field, $documentDbRef)->save(); |
| 326 |
|
} |
| 327 |
|
break; |
| 328 |
|
|
| 329 |
|
default: |