Path: blob/master/src/infrastructure/diff/inline/PhabricatorDiffInlineCommentContentState.php
12242 views
<?php12final class PhabricatorDiffInlineCommentContentState3extends PhabricatorInlineCommentContentState {45private $hasSuggestion = false;6private $suggestionText = '';78public function isEmptyContentState() {9if (!parent::isEmptyContentState()) {10return false;11}1213if ($this->getContentHasSuggestion()) {14if (strlen($this->getContentSuggestionText())) {15return false;16}17}1819return true;20}2122public function setContentSuggestionText($suggestion_text) {23$this->suggestionText = $suggestion_text;24return $this;25}2627public function getContentSuggestionText() {28return $this->suggestionText;29}3031public function setContentHasSuggestion($has_suggestion) {32$this->hasSuggestion = $has_suggestion;33return $this;34}3536public function getContentHasSuggestion() {37return $this->hasSuggestion;38}3940public function newStorageMap() {41return parent::writeStorageMap() + array(42'hasSuggestion' => $this->getContentHasSuggestion(),43'suggestionText' => $this->getContentSuggestionText(),44);45}4647public function readStorageMap(array $map) {48$result = parent::readStorageMap($map);4950$has_suggestion = (bool)idx($map, 'hasSuggestion');51$this->setContentHasSuggestion($has_suggestion);5253$suggestion_text = (string)idx($map, 'suggestionText');54$this->setContentSuggestionText($suggestion_text);5556return $result;57}5859protected function newStorageMapFromRequest(AphrontRequest $request) {60$map = parent::newStorageMapFromRequest($request);6162$map['hasSuggestion'] = (bool)$request->getBool('hasSuggestion');63$map['suggestionText'] = (string)$request->getStr('suggestionText');6465return $map;66}6768}697071