Próbuję dzisiaj zmusić do działania rozrszerzenie Tree z DoctrineExtension z MongoDB.
Zainstalowałem też StofDoctrineExtensionsBundle.

Przy próbie zapisu dokumentu do bazy dostaję taki komunikat:

Cytat
Cannot persist an embedded document or mapped superclass My\FrontendBundle\Document\Category


Moja konfiguracja wygląda następująco:
  1. doctrine_mongodb:
  2. connections:
  3. default:
  4. server: mongodb://localhost:27017
  5. options: {}
  6. default_database: plik
  7. document_managers:
  8. default:
  9. auto_mapping: true
  10. mappings:
  11. gedmo_tree:
  12. type: yml
  13. prefix: Gedmo\Tree\Document
  14. dir: "%kernel.root_dir%/../vendor/gedmo/doctrine-extensions/lib/Gedmo/Tree/Document"
  15. alias: GedmoTree # this one is optional and will default to the name set for the mapping
  16. is_bundle: false
  17. stof_doctrine_extensions:
  18. default_locale: en_US
  19. mongodb:
  20. default:
  21. tree: true


Plik mapowania:
  1. My\FrontendBundle\Document\Category:
  2. type: mappedSuperclass
  3. repositoryClass: Gedmo\Tree\Document\MongoDB\Repository\MaterializedPathRepository
  4. collection: categories
  5. gedmo:
  6. tree:
  7. type: materializedPath
  8. activateLocking: true
  9. fields:
  10. id:
  11. id: true
  12. title:
  13. type: string
  14. gedmo:
  15. - sluggable
  16. slug:
  17. type: string
  18. gedmo:
  19. 0: treePathSource
  20. slug:
  21. unique: false
  22. fields:
  23. - title
  24. path:
  25. type: string
  26. gedmo:
  27. treePath:
  28. separator: '/'
  29. appendId: false
  30. startsWithSeparator: false # default
  31. endsWithSeparator: true # default
  32. level:
  33. type: int
  34. name: lvl
  35. nullable: true
  36. gedmo:
  37. - treeLevel
  38. lockTime:
  39. type: date
  40. gedmo:
  41. - treeLockTime
  42. hash:
  43. type: string
  44. gedmo:
  45. - treePathHash
  46. parent:
  47. reference: true
  48. type: one
  49. inversedBy: children
  50. targetDocument: My\FrontendBundle\Document\Category
  51. simple: true
  52. gedmo:
  53. - treeParent


Wszystko wygląda dobrze, nie wiem co może być nie tak, proszę o pomoc.