|
@@ 326-331 (lines=6) @@
|
| 323 |
|
foreach ($attributes as $name => $value) { |
| 324 |
|
if ($this->hasAttributeIndex($name) === true) { |
| 325 |
|
$this->executeBlock($value, $this->getAttributeIndex($name)); |
| 326 |
|
} elseif ($this->isIgnoreUnknowns() === false) { |
| 327 |
|
$title = $this->formatMessage(ErrorCodes::INVALID_VALUE); |
| 328 |
|
$details = $this->formatMessage(ErrorCodes::UNKNOWN_ATTRIBUTE); |
| 329 |
|
$status = $this->getErrorStatus(); |
| 330 |
|
$this->getJsonApiErrorCollection()->addDataAttributeError($name, $title, $details, $status); |
| 331 |
|
} |
| 332 |
|
} |
| 333 |
|
} |
| 334 |
|
} |
|
@@ 386-392 (lines=7) @@
|
| 383 |
|
} elseif (array_key_exists($name, $toManyIndexes) === true) { |
| 384 |
|
// it might be toMany relationship |
| 385 |
|
$this->validateAsToManyRelationship($toManyIndexes[$name], $name, $relationship); |
| 386 |
|
} else { |
| 387 |
|
// unknown relationship |
| 388 |
|
$title = $this->formatMessage(ErrorCodes::INVALID_VALUE); |
| 389 |
|
$details = $this->formatMessage(ErrorCodes::UNKNOWN_RELATIONSHIP); |
| 390 |
|
$status = $this->getErrorStatus(); |
| 391 |
|
$this->getJsonApiErrorCollection()->addRelationshipError($name, $title, $details, $status); |
| 392 |
|
} |
| 393 |
|
} |
| 394 |
|
} |
| 395 |
|
} |
|
@@ 468-475 (lines=8) @@
|
| 465 |
|
$isParsed = false; |
| 466 |
|
} |
| 467 |
|
|
| 468 |
|
if ($isParsed === true) { |
| 469 |
|
// All right we got something. Now pass it to a validation rule. |
| 470 |
|
$this->executeBlock($collectedPairs, $index); |
| 471 |
|
} else { |
| 472 |
|
$title = $this->formatMessage(ErrorCodes::INVALID_VALUE); |
| 473 |
|
$details = $this->formatMessage(ErrorCodes::INVALID_RELATIONSHIP); |
| 474 |
|
$this->getJsonApiErrorCollection()->addRelationshipError($name, $title, $details, $this->getErrorStatus()); |
| 475 |
|
} |
| 476 |
|
} |
| 477 |
|
|
| 478 |
|
/** |