public function commit() { switch ($this->action) { case 'undo-edit-header': case 'edit-header': $this->workflow->updateLastModified($this->newRevision->getRevisionId()); $this->storage->put($this->workflow, array()); // 'discussion' workflow $this->storage->put($this->newRevision, array('workflow' => $this->workflow)); // Reload $this->header for renderApi() after save $this->header = $this->newRevision; return array('header-revision-id' => $this->newRevision->getRevisionId()); default: throw new InvalidActionException('Unrecognized commit action', 'invalid-action'); } }