Overwrite Document/Page model for new Document tab in Backend UI


#1

Hi guys,

I created a new document tab in the admin panel called ‘Major Versions’ and I want to add the function getMajorVersions() inside Pimcore\Model\Document\PageSnippet - how can I do that?

I tried overwriting the class but I can’t manage to do it properly - it does not work

added in config.yml: Pimcore\Model\Document\PageSnippet : AppBundle\Model\Document\PageSnippet, then:
namespace AppBundle\Model\Document;

class PageSnippet extends \Pimcore\Model\Document\PageSnippet
{
public function getMajorVersions() {}

but this does not work. any ideas anyone?

Best,
Alex


#2

Hi,
why doesn’t it work? Any error messages or are created documents not an instance of your implementation?
Did you clear all caches (symfony + data cache)?

BR
Christian


#3

I think he means to add it to all sub-types of PageSnippet (Document, Email, Newsletter) by changing the parent relation of PageSnippet, but thats not possible.