I'm following this http://book.cakephp.org/3.0/en/orm/behaviors/tree.html to make simple category tree.
You can make a node a root in the tree by setting the ‘parent_id’ column to null:
$aCategory = $categoriesTable->get(10);
$aCategory->parent_id = null;
$categoriesTable->save($aCategory);
this does not work to add new root node (I didn't understand why it's 10 there) I'm have empty table
please guide, me how to get started with root and the add child nodes to it
CREATE TABLE IF NOT EXISTS `categories` (
`id` int(11) NOT NULL,
`parent_id` int(11) DEFAULT NULL,
`category_slug` varchar(250) DEFAULT NULL,
`category_name` varchar(250) DEFAULT NULL,
`lft` int(11) DEFAULT NULL,
`rght` int(11) DEFAULT NULL
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;