{"record":{"id":"4042bf65b0c8eee7","repo":"getgrav/grav","slug":"s-relationship-has-too-many-objects-in-it","errorCode":null,"errorMessage":"%s relationship has too many objects in it","messagePattern":"(.+?) relationship has too many objects in it","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"system/src/Grav/Framework/Relationships/Traits/RelationshipTrait.php","lineNumber":97,"sourceCode":"     */\n    abstract public function count(): int;\n\n    /**\n     * @return void\n     * @phpstan-pure\n     */\n    public function check(): void\n    {\n        $min = $this->options['min'] ?? 0;\n        $max = $this->options['max'] ?? 0;\n\n        if ($min || $max) {\n            $count = $this->count();\n            if ($min && $count < $min) {\n                throw new RuntimeException(sprintf('%s relationship has too few objects in it', $this->name));\n            }\n            if ($max && $count > $max) {\n                throw new RuntimeException(sprintf('%s relationship has too many objects in it', $this->name));\n            }\n        }\n    }\n\n    /**\n     * @param IdentifierInterface $identifier\n     * @return IdentifierInterface\n     */\n    private function checkIdentifier(IdentifierInterface $identifier): IdentifierInterface\n    {\n        if ($this->type !== $identifier->getType()) {\n            throw new RuntimeException(sprintf('Bad identifier type %s', $identifier->getType()));\n        }\n\n        if ($identifier::class !== Identifier::class) {\n            return $identifier;\n        }\n","sourceCodeStart":79,"sourceCodeEnd":115,"githubUrl":"https://github.com/getgrav/grav/blob/6040efed04efa69b8209448ed81308e7c24147c2/system/src/Grav/Framework/Relationships/Traits/RelationshipTrait.php#L79-L115","documentation":"Error \"%s relationship has too many objects in it\" thrown in getgrav/grav.","triggerScenarios":"Thrown at system/src/Grav/Framework/Relationships/Traits/RelationshipTrait.php:97 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6040efed04efa69b8209448ed81308e7c24147c2","analyzedAt":"2026-08-17T05:07:31.593Z","schemaVersion":2},"datasetVersion":"2026-08-17T09:17:11.063Z"}