Differential D20562 Diff 49051 src/applications/transactions/storage/PhabricatorApplicationTransaction.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/transactions/storage/PhabricatorApplicationTransaction.php
Show First 20 Lines • Show All 121 Lines • ▼ Show 20 Lines | public function setContentSource(PhabricatorContentSource $content_source) { | ||||
return $this; | return $this; | ||||
} | } | ||||
public function getContentSource() { | public function getContentSource() { | ||||
return PhabricatorContentSource::newFromSerialized($this->contentSource); | return PhabricatorContentSource::newFromSerialized($this->contentSource); | ||||
} | } | ||||
public function hasComment() { | public function hasComment() { | ||||
return $this->getComment() && strlen($this->getComment()->getContent()); | if (!$this->getComment()) { | ||||
return false; | |||||
} | |||||
$content = $this->getComment()->getContent(); | |||||
// If the content is empty or consists of only whitespace, don't count | |||||
// this as comment. | |||||
if (!strlen(trim($content))) { | |||||
return false; | |||||
} | |||||
return true; | |||||
} | } | ||||
public function getComment() { | public function getComment() { | ||||
if ($this->commentNotLoaded) { | if ($this->commentNotLoaded) { | ||||
throw new Exception(pht('Comment for this transaction was not loaded.')); | throw new Exception(pht('Comment for this transaction was not loaded.')); | ||||
} | } | ||||
return $this->comment; | return $this->comment; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 1,655 Lines • Show Last 20 Lines |