Answer the question
In order to leave comments, you need to log in
How to organize tree categories in Symfony 3?
Symfony 3.
There is a Category entity, it has id, name, title, body fields with demo lines.
To implement a nested structure, I'm trying to add two fields parent and pos .
For parent :
/**
* @var int
*
* @ORM\Column(name="parent", type="smallint", nullable=false, unique=false)
*/
/**
* @var int
*
* @ORM\Column(name="pos", type="smallint", nullable=false, unique=true)
* @ORM\GeneratedValue(strategy="AUTO")
*/
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '0' f
or key 'UNIQ_64C19C180D9E6AC'
Answer the question
In order to leave comments, you need to log in
like it only works with SF2 Is it possible to throw version 3?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question