Relation between DataObject and custom persistent model


How can I define realations between DataObjects and custom persistent model (doctrine ORM)?

I have a DataObject called “rentalUnit” an a custom persistent model called “prices”. Each rentalUnit can have
one price. How can I tell rentalUnit that there is one price relation? The relation should be set programmatically.




CoreShop does this everywhere, you could have a look at it. Especially the ResourceBundle adds a lot for that stuff: Also the other way around works with CoreShop, having a relation between a Doctrine Entity and CoreShop like here:


Thank you. Are there any docs on doing this? It’s not easy to understand such a complex example like CoreShop :flushed:.


Basically all you need to do is create a custom object-tag like or use ResourceBundle and create Doctrine entities the way CoreShop does, that way it generates factories, repositories and other stuff automatically for you.


Like this in the docs -


yes, exactly. CoreShop would already add an abstract for that, so you only would need to extend from it and overwrite certain functions.


Are there any docs on how to build up the JavaScript classes? The Link “For examples have a look at the Pimcore core datatypes at github” in pimcore doc is nice but at the moment I can’t understand the relations between all the different files.


you need to create 2 js files, data and tag. CoreShop has a base class to do that:

Tag is for the actual editable

Data is for the class editor

Concrete implementation for a entity: