Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.
<?php

namespace PhpOffice\PhpSpreadsheet\Chart;

> use PhpOffice\PhpSpreadsheet\RichText\RichText; class Title >
{ /** * Title Caption. *
< * @var string
> * @var array|RichText|string
*/
< private $caption;
> private $caption = '';
/** * Title Layout. *
< * @var Layout
> * @var ?Layout
*/ private $layout; /** * Create a new Title. *
< * @param null|mixed $caption
> * @param array|RichText|string $caption
*/
< public function __construct($caption = null, ?Layout $layout = null)
> public function __construct($caption = '', ?Layout $layout = null)
{ $this->caption = $caption; $this->layout = $layout; } /** * Get caption. *
< * @return string
> * @return array|RichText|string
*/ public function getCaption() { return $this->caption; }
> public function getCaptionText(): string /** > { * Set caption. > $caption = $this->caption; * > if (is_string($caption)) { * @param string $caption > return $caption; * > } * @return $this > if ($caption instanceof RichText) { */ > return $caption->getPlainText(); public function setCaption($caption) > } { > $retVal = ''; $this->caption = $caption; > foreach ($caption as $textx) { > /** @var RichText|string */ return $this; > $text = $textx; } > if ($text instanceof RichText) { > $retVal .= $text->getPlainText(); /** > } else { * Get Layout. > $retVal .= $text; * > } * @return Layout > } */ > public function getLayout() > return $retVal; { > } return $this->layout; >
< * @param string $caption
> * @param array|RichText|string $caption
< /** < * Get Layout. < * < * @return Layout < */ < public function getLayout()
> public function getLayout(): ?Layout