I have followed the docs:
https://github.com/Atlantic18/DoctrineExtensions/blob/v2.4.x/doc/tree.md#materialized-path
I am getting the following error:
An exception occurred while executing 'UPDATE task SET path = ?, task_id = ?, lvl = ? WHERE id = ?' with params ["-1", "-1", 0, 1]:
SQLSTATE[22003]: Numeric value out of range: 1264 Out of range value for column 'task_id' at row 1
Here is my entity:
<?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
/**
* @ORM\Entity(repositoryClass="Gedmo\Tree\Entity\Repository\MaterializedPathRepository")
* @Gedmo\Tree(type="materializedPath")
*/
class Task
{
/**
* @ORM\Id
* @ORM\Column(type="integer", options={"unsigned":true})
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @ORM\Column(type="string", length=128, nullable=false)
*/
private $title;
/**
* @ORM\Column(type="integer", nullable=true)
* @Gedmo\TreeLevel
*/
private $lvl;
/**
* @ORM\Column(type="integer", nullable=true)
* @Gedmo\TreeLeft
*/
private $lft;
/**
* @ORM\Column(type="integer", nullable=true)
* @Gedmo\TreeRight
*/
private $rgt;
/**
* @ORM\Column(type="string", nullable=true)
* @Gedmo\TreePath(separator=".", startsWithSeparator=false, endsWithSeparator=false)
*/
private $path;
/**
* @ORM\Column(type="string", nullable=true)
* @Gedmo\TreePathSource
*/
private $source;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Task", mappedBy="parent")
* @ORM\OrderBy({"lft":"ASC"})
*/
private $children;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Task")
* @ORM\JoinColumn(name="task_id", referencedColumnName="id", onDelete="CASCADE")
* @Gedmo\TreeRoot
*/
private $root;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Task", inversedBy="children")
* @ORM\JoinColumn(name="parent_id", referencedColumnName="id", onDelete="CASCADE")
* @Gedmo\TreeParent
*/
private $parent;
}
What am I not understanding or what am I missing about the configuration for materialized path?
Why are the node ID's coming up as negative also??? Very odd...