code: public function duplicate($doWrite = true)
      {
          $clonedNode = parent::duplicate($doWrite);
  
          if ($this->Options()) {
              foreach ($this->Options() as $field) {
                  $newField           = $field->duplicate();
                  $newField->ParentID = $clonedNode->ID;
                  $newField->write();
              }
          }
  
          return $clonedNode;
      }
docs: Duplicate a pages content. We need to make sure all the fields attached
  to that page go with it.
  
  @param bool $doWrite
  
  @return DataObject