Skip to content

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

@jcs

Description

@jcs

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions