I'm trying to follow these steps:
Please, correct me if I am wrong. Firstly, I've created this class in AppBundle/Model route:
class Item extends Doctrine_Record
public function setTableDefinition()
$this->hasColumn('name', 'string', 255);
public function setUp()
$treeObject = Doctrine_Core::getTable('Category')->getTree();
Doctrine has it's bundle for Symfony, that allows to store all config data in YML. https://symfony.com/doc/current/bundles/StofDoctrineExtensionsBundle/index.html - it has "Tree extension" and it is what you're looking for.