Hello to everyone,
I would like to create a Processor that will delete multiple objects at once. A similar example is the deletion of multiple users from the "Manage Users" menu.
However, the Processor of the above action is a script while I would like to use a class-based Processor.
That is why I was thinking of extending the modObjectProcessor and on the "process" method utilize the custom "removeProcesor" I have created for this specific class of objects.
Example Code
file: removeall.class.php
class myRemoveAllProcessor extends modObjectProcessor {
...
public function process() {
foreach ($objects as $object) {
$this->modx->runProcessor('my/object/remove/', $object->toArray(), array(
'processors_path' => 'path/to/my/processors/'
));
}
}
...
}
However, because I have not seen it anywhere inside the MODx source I would like to know if there is anything wrong with calling one Processor from inside another?
And if this is considered bad practice, could anyone suggest another solution to this problem?
Thanks a lot.