. */ /** * Class ReportBaseElement */ class ReportBaseElement { /** * @var string */ public $text = ""; /** * Element renderer * * @param ReportHtml|ReportTcpdf $renderer */ public function render($renderer) { //-- to be implemented in inherited classes } /** * @param ReportHtml|ReportTcpdf $renderer * * @return float */ public function getHeight($renderer) { return 0.0; } /** * @param ReportHtml|ReportTcpdf $renderer * * @return float */ public function getWidth($renderer) { return 0.0; } /** * @param string $t * * @return int */ public function addText($t) { $t = trim($t, "\r\n\t"); $t = str_replace(array("
", " "), array("\n", " "), $t); $t = strip_tags($t); $t = htmlspecialchars_decode($t); $this->text .= $t; return 0; } /** * @return int */ public function addNewline() { $this->text .= "\n"; return 0; } /** * @return string */ public function getValue() { return $this->text; } /** * @param $wrapwidth * @param $cellwidth * * @return int */ public function setWrapWidth($wrapwidth, $cellwidth) { return 0; } /** * @param $renderer */ public function renderFootnote($renderer) { // To be implemented in inherited classes } /** * @param $text */ public function setText($text) { $this->text = $text; } }