|
@@ 421-431 (lines=11) @@
|
| 418 |
|
$modelClass = $schema::MODEL; |
| 419 |
|
|
| 420 |
|
$relationshipCaptures = []; |
| 421 |
|
foreach ($toOneRules as $name => $rule) { |
| 422 |
|
assert(is_string($name) === true && empty($name) === false && $rule instanceof RuleInterface); |
| 423 |
|
$modelRelName = $schema->getRelationshipMapping($name); |
| 424 |
|
$captureName = $modelSchemes->getForeignKey($modelClass, $modelRelName); |
| 425 |
|
$expectedSchema = $jsonSchemes->getModelRelationshipSchema($modelClass, $modelRelName); |
| 426 |
|
$relationshipCaptures[$name] = $this->createSingleData( |
| 427 |
|
$name, |
| 428 |
|
static::equals($expectedSchema::TYPE), |
| 429 |
|
static::singleCapture($captureName, $rule, $aggregator) |
| 430 |
|
); |
| 431 |
|
} |
| 432 |
|
foreach ($toManyRules as $name => $rule) { |
| 433 |
|
assert(is_string($name) === true && empty($name) === false && $rule instanceof RuleInterface); |
| 434 |
|
$modelRelName = $schema->getRelationshipMapping($name); |
|
@@ 432-442 (lines=11) @@
|
| 429 |
|
static::singleCapture($captureName, $rule, $aggregator) |
| 430 |
|
); |
| 431 |
|
} |
| 432 |
|
foreach ($toManyRules as $name => $rule) { |
| 433 |
|
assert(is_string($name) === true && empty($name) === false && $rule instanceof RuleInterface); |
| 434 |
|
$modelRelName = $schema->getRelationshipMapping($name); |
| 435 |
|
$expectedSchema = $jsonSchemes->getModelRelationshipSchema($modelClass, $modelRelName); |
| 436 |
|
$captureName = $modelRelName; |
| 437 |
|
$relationshipCaptures[$name] = $this->createMultiData( |
| 438 |
|
$name, |
| 439 |
|
static::equals($expectedSchema::TYPE), |
| 440 |
|
static::multiCapture($captureName, $rule, $aggregator) |
| 441 |
|
); |
| 442 |
|
} |
| 443 |
|
|
| 444 |
|
return $relationshipCaptures; |
| 445 |
|
} |