public function __construct($controller, $name, DataObjectInterface $object)
 {
     $this->object = $object;
     $fields = $object->getFrontEndFields(array(get_class($object) => $object));
     $fields->push(new HiddenField("ID", "ID"));
     $actions = new FieldList(new FormAction("save", "Save " . $object->i18n_singular_name()));
     parent::__construct($controller, $name, $fields, $actions);
     $object->extend('updateEditComponentForm', $this);
     if ($this->object->isInDB()) {
         $this->loadDataFrom($this->object);
     }
     //all fields are required
     if (!$this->validator) {
         $this->setValidator(new RequiredFields(array_keys($fields->saveableFields())));
     }
 }