class CustomPage extends Page { public function onAfterWrite() { parent::onAfterWrite(); // Additional functionality can be added here } } $obj = new CustomPage(); $obj->Title = 'My New Page'; $obj->Content = 'This is a sample page content'; $obj->write(); // Triggers onAfterWrite functionThe above example is using the SilverStripe framework, indicating that this onAfterWrite function belongs to the SilverStripe CMS library.