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?