code: public function doPublishAndClose($data, $form)
      {
          Controller::curr()->getResponse()->addHeader("X-Pjax", "Content");
          return $this->publish($data, $form, $this->owner, $this->getBackLink());
      }
docs: Publishes the record and closes the detail form
  @param  array $data The form data
  @param  Form $form The Form object
  @return HTTPResponse