Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/infrastructure/diff/inline/PhabricatorInlineCommentContentState.php
12242 views
1
<?php
2
3
abstract class PhabricatorInlineCommentContentState
4
extends Phobject {
5
6
private $contentText = '';
7
8
public function setContentText($content_text) {
9
$this->contentText = $content_text;
10
return $this;
11
}
12
13
public function getContentText() {
14
return $this->contentText;
15
}
16
17
public function isEmptyContentState() {
18
return !strlen($this->getContentText());
19
}
20
21
public function writeStorageMap() {
22
return array(
23
'text' => $this->getContentText(),
24
);
25
}
26
27
public function readStorageMap(array $map) {
28
$text = (string)idx($map, 'text');
29
$this->setContentText($text);
30
31
return $this;
32
}
33
34
final public function readFromRequest(AphrontRequest $request) {
35
$map = $this->newStorageMapFromRequest($request);
36
return $this->readStorageMap($map);
37
}
38
39
protected function newStorageMapFromRequest(AphrontRequest $request) {
40
$map = array();
41
42
$map['text'] = (string)$request->getStr('text');
43
44
return $map;
45
}
46
47
}
48
49