user198729
user198729

Reputation: 63646

How to implement this with NestedSet behavior in doctrine?

Task:
  columns:
    name: string(100)
    parent_id: integer
  relations:
    Parent:
      class: Task
      local: parent_id
      foreign: id
      foreignAlias: Subtasks

Upvotes: 1

Views: 293

Answers (1)

Thomas Schaub
Thomas Schaub

Reputation: 418

See http://www.doctrine-project.org/documentation/manual/1_1/hu/hierarchical-data

Task:
    actAs: [NestedSet]
    columns:
        name: string(100)

You don't need to care about an parent id or anything, doctrine does the bookkeeping for you.

Upvotes: 1

Related Questions