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

Wrong Model definition for Comment #79

Open
calvinalkan opened this issue Feb 9, 2021 · 0 comments
Open

Wrong Model definition for Comment #79

calvinalkan opened this issue Feb 9, 2021 · 0 comments

Comments

@calvinalkan
Copy link

The post relationship inside the is wrong and will generate a critical error when you try to to the following:

$comment = Comment::find(2)->post->post_title;

Instead of a hasOne relationship it should be a belongsTo like this:

return $this->belongsTo('WeDevs\ORM\WP\Post', 'comment_post_ID');

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

No branches or pull requests

1 participant