Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add error message if relationship is missing for dot notation #71

Merged
merged 2 commits into from
Mar 26, 2023

Conversation

chrispenny
Copy link
Member

If you created a cares for a relationship with dot notation, EG:

private static array $has_many = [
    'Links' => Link::class . '.MenuGroup',
];

private static array $cares = [
    'Links',
];

But there was no corresponding relationship on the other end (in this case, Link::class was missing a has_one), then an getRelationType() would return null, and Edge::__construct() would throw an unhelpful exception because $relationType must be string.

@chrispenny chrispenny merged commit 00fc48a into main Mar 26, 2023
@chrispenny chrispenny deleted the bugfix/missing-error-message branch March 26, 2023 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant