Symfony / Doctrine materializedPath issues

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 AppEntity;

use DoctrineCommonCollectionsArrayCollection;
use DoctrineCommonCollectionsCollection;
use DoctrineORMMapping as ORM;
use GedmoMappingAnnotation as Gedmo;

/**
 * @ORMEntity(repositoryClass="GedmoTreeEntityRepositoryMaterializedPathRepository")
 * @GedmoTree(type="materializedPath")
 */
class Task
{
    /**
     * @ORMId
     * @ORMColumn(type="integer", options={"unsigned":true})
     * @ORMGeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @ORMColumn(type="string", length=128, nullable=false)
     */
    private $title;

    /**
     * @ORMColumn(type="integer", nullable=true)
     * @GedmoTreeLevel
     */
    private $lvl;

    /**
     * @ORMColumn(type="integer", nullable=true)
     * @GedmoTreeLeft
     */
    private $lft;

    /**
     * @ORMColumn(type="integer", nullable=true)
     * @GedmoTreeRight
     */
    private $rgt;

    /**
     * @ORMColumn(type="string", nullable=true)
     * @GedmoTreePath(separator=".", startsWithSeparator=false, endsWithSeparator=false)
     */
    private $path;

    /**
     * @ORMColumn(type="string", nullable=true)
     * @GedmoTreePathSource
     */
    private $source;

    /**
     * @ORMOneToMany(targetEntity="AppEntityTask", mappedBy="parent")
     * @ORMOrderBy({"lft":"ASC"})
     */
    private $children;

    /**
     * @ORMManyToOne(targetEntity="AppEntityTask")
     * @ORMJoinColumn(name="task_id", referencedColumnName="id", onDelete="CASCADE")
     * @GedmoTreeRoot
     */
    private $root;

    /**
     * @ORMManyToOne(targetEntity="AppEntityTask", inversedBy="children")
     * @ORMJoinColumn(name="parent_id", referencedColumnName="id", onDelete="CASCADE")
     * @GedmoTreeParent
     */
    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…

Source: Symfony Questions

Was this helpful?

0 / 0

Leave a Reply 0

Your email address will not be published. Required fields are marked *