Skip to content

creating a belongs_to association to a model's same class doesn't work #3

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

Closed
jcs opened this issue Jul 7, 2009 · 1 comment
Closed

Comments

@jcs
Copy link
Contributor

jcs commented Jul 7, 2009

a class that has a belongs_to relationship to the same class can't be defined without causing an infinite regression until php runs out of memory.

with a sql schema of

create table posts (id int, parent_post_id int)

and a Post.php of

class Post extends ActiveRecord\Model {
    static $belongs_to = array(
         array("parent_post", "class_name" => "Post")
    );
}

it will regress infinitely when trying to load the model.

@jpfuentes2
Copy link
Owner

This has been fixed. Please pull latest changes. Thanks.

murayama referenced this issue in murayama/php-activerecord Mar 6, 2013
include時の不具合を修正しました
This issue was closed.
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

2 participants