Q
Q
Qixing2015-01-27 14:58:47
symfony
Qixing, 2015-01-27 14:58:47

How to get subcategories in symfony?

There is a table with categories of the 2nd and 3rd levels.
id . parent_id . name
How to describe YML and write a request in the controller so that I can get the child categories of the 2nd and 3rd levels?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
keltanas, 2015-01-27
@Qixing

Have a look at https://github.com/KnpLabs/DoctrineBehaviors#tree

I
Ivan, 2015-01-27
@0neS

...\ProductCategory:
    type: entity
    table: product_categories
    ...
    manyToOne:
        parent:
            targetEntity: ...\ProductCategory
    id:
        id:
            type: integer
            id: true
            generator:
                strategy: AUTO
    fields:
        name:
            type: string
            length: 255
        ...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question