/** * Publishing Versioning support. * * When publishing it needs to handle copying across / publishing * each of the individual field options * * @return void */ public function doPublish($fromStage, $toStage, $createNewVersion = false) { $live = Versioned::get_by_stage("EditableOption", "Live", "\"EditableOption\".\"ParentID\" = {$this->ID}"); if ($live) { foreach ($live as $option) { $option->delete(); } } if ($this->Options()) { foreach ($this->Options() as $option) { $option->publish($fromStage, $toStage, $createNewVersion); } } parent::doPublish($fromStage, $toStage, $createNewVersion); }