Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
FormIt hook for Doodles extra (MODX Revolution)
<?php
$doodle = $modx->getService('doodles','Doodles',$modx->getOption('doodles.core_path',null,$modx->getOption('core_path').'components/doodles/').'model/doodles/');
if (!($doodle instanceof Doodles)) {
$hook->addError('error_message','Unable to load doodle service.');
return false;
};
$newEntry = $modx->newObject('Doodle');
$newEntry->fromArray($scriptProperties['fields']);
/* save */
if ($newEntry->save() == false) {
$hook->addError('error_message','Unable to add new doodle entry to the database.');
}
return true;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.