We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37108
    • 80 Posts
    I've created a migxdb package "varcontent" which needs a few custom processors to alter the format of some of the data (such as creation and update dates). The package has three objects: "vcSections," "vcSidebars," and "vcDataGraphics," each having its own tv using a discrete migx config to enter data in the manager. Normally, taking migx out of the equation and using the create processor for example, one would extend the modObjectCreateProcessor. For instance, in /core/components/varcontent/processors/mgr/vcsections/create.class.php this would transform my data point "createdon" to unixtime (saving all other data points as they would by default):

    class vcSectionsCreateProcessor extends modObjectCreateProcessor {
    
        public $classKey = 'vcSections';
        public $languageTopics = array('varcontent:default');
        public $objectType = 'varcontent.sections';
    
        public function beforeSet(){
            $this->setProperty('createdon',time());
            return parent::beforeSet();
        }
    }
    
    return 'vcSectionsCreateProcessor';
    


    However, looking at an example component "migxchildresources" and other examples, I'm seeing this is probably not how it's done with a migxdb package. How would the above be achieved in this context? A couple assumptions:

    • The file name should be create.php (as opposed to create.class.php)
    • My custom create.php should not be a class and therefore extends neither migx's create functionality nor modx's modObjectCreateProcessor. The file must handle all create functionality(?)

    Next, what should the migxdb config's processorspath be set to assuming this full path: /core/components/varcontent/processors/mgr/vcsections/create.php?

    This question has been answered by Bruno17. See the first response.

    • discuss.answer
      • 4172
      • 5,888 Posts
      you can make a copy of the default migx-update-processor (update.php) under

      core/components/yourPackage/processors/mgr/default/update.php

      and do your modifications on that one.
      MIGXdb does use this update-processor then by default for your package.

      If you need individual update-processors fill out the field 'processorspath' for this configurations

      Then MIGXdb does use this one, (if it exists):
      core/components/yourPackage/processors/mgr/yourProcessorspath/update.php

      MIGXdb doesn't use class - based processors (yet)
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!