• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Can I do this with the datawriter?

Jaxel

Well-known member
#1
Code:
$dw = XenForo_DataWriter::create('EWRcarta_DataWriter_Pages');
$dw->setExistingData($input);

$dw->bulkSet(array(
    'page_name'    => $input['page_name'],
    'page_slug' => $input['page_slug'],
    'page_type' => $input['page_type'],
    'page_content' => $input['page_content'],
    'page_parent' => $input['page_parent'],
    'page_index' => $input['page_index'],
    'page_protect' => $input['page_protect'],
    'page_sidebar' => $input['page_sidebar'],
    'page_sublist' => $input['page_sublist']
));
$dw->save();
$input['page_id'] = $dw->get('page_id');
$input['page_date'] = $dw->get('page_date');

if (DATA 'page_content' WAS CHANGED)
{
    $this->getModelFromCache('EWRcarta_Model_History')->updateHistory($input);
}
Basically, I only want to run the updateHistory function if 'page_content' was recently changed. Is this possible?