What is the actual question - there is such a table:
/** * @ORM\Column(type="integer") * @ORM\Id * @ORM\GeneratedValue(strategy="AUTO") * @ORM\OneToMany(targetEntity="Category", mappedBy="parent") */ private $id; /** * @ORM\Column(type="string", length=100) */ private $name; /** * @ORM\Column(type="string", length=100) */ private $slug; /** * @ORM\ManyToOne(targetEntity="Category", inversedBy="id") * @ORM\JoinColumn(name="parent", referencedColumnName="id", unique=false) */ private $parent; public function __toString() { return (String) $this->getParent(); } /** * @ORM\ManyToMany(targetEntity="Post", mappedBy="category", cascade={"persist"}) */ private $posts; public function __construct() { $this->posts = new \Doctrine\Common\Collections\ArrayCollection(); } Is there any ready-made method in ORM or in SYMFONY so that when adding data to the table it was impossible to do so:
Or do you need to do the checking yourself before adding the data?
I would be very grateful for the answers! Thank.
