1<?php 2 3/** 4 * An HtmlDescribable is an item within a feed that can have a description that may 5 * include HTML markup. 6 */ 7class HtmlDescribable 8{ 9 /** 10 * Indicates whether the description field should be rendered in HTML. 11 */ 12 public $descriptionHtmlSyndicated; 13 14 /** 15 * Indicates whether and to how many characters a description should be truncated. 16 */ 17 public $descriptionTruncSize; 18 19 /** @var string the Description */ 20 public $description; 21 22 /** 23 * Returns a formatted description field, depending on descriptionHtmlSyndicated and 24 * $descriptionTruncSize properties 25 * 26 * @param bool $overrideSyndicateHtml 27 * @return string the formatted description 28 */ 29 public function getDescription($overrideSyndicateHtml = false) 30 { 31 $descriptionField = new FeedHtmlField($this->description); 32 $descriptionField->syndicateHtml = $overrideSyndicateHtml || $this->descriptionHtmlSyndicated; 33 $descriptionField->truncSize = $this->descriptionTruncSize; 34 35 return $descriptionField->output(); 36 } 37} 38