Symfony CMF Database Schema

415 views Asked by At

I have started to look into Symfony CMF, and I must say it looks good! However, I can't get my head around the database Schema! I have read up on the basics of PHPCR, and understand it to an extent. The bit that is confusing me are all the extra tables that Symfony CMF installs. I.E

  • phpcr_binarydata
  • phpcr_internal_index_types
  • phpcr_namespaces
  • phpcr_nodes
  • phpcr_nodes_references
  • phpcr_nodes_weakreferences
  • phpcr_type_childs
  • phpcr_type_nodes
  • phpcr_type_props
  • phpcr_workspaces

What are all these used for? The only table I can make sense of is phpcr_nodes and the XML / property data stored! Some tables have data and are being queried - but I can't see any reference to them in phpcr_nodes!

For example:

Table "phpcr_type_nodes" has data such as

name: phpcr:managed supertype: nt:base

Table "phpcr_type_props" has data such as

name: copyright

1

There are 1 answers

2
dbu On BEST ANSWER

When you see this schema, it means you are using Jackalope Doctrine DBAL, which is one possible implementation of the PHPCR API. This implements PHPCR on top of a relational database. Unfortunately, there is not too much documentation available, but all of those tables are used.

If you want to learn more about PHPCR, i recommend to have a look at this PHPCR Tutorial . If you really want to understand the database schema in detail, you will need to dig through the source code of Hackalope Doctrine DBAL.

Note that you can also use doctrine ORM with the CMF. The RoutingBundle already brings mapping for it, for other bundles it would be doable to implement ORM mappings and we would be glad for contributions.

PS: I never figured out how to get notifications after the initial notification on stackoverflow, so best open an issue on the relevant github repository if you need more information.