/** * AbstractCompoundType Constructor. * * @param string $title The title * @param string $id The identifier * @param \stdClass $params The parameters * @param ContentTypeInterface[] $elements Content elements */ public function __construct($title, $id, $params, $elements = []) { parent::__construct($title, $id, $params); foreach ($elements as $element) { $this->add($element); } }
/** * Link constructor. * */ public function __construct($href, $text) { parent::__construct('Link', 'link-' . spl_object_hash($this), new \stdClass()); $this->href = $href; $this->text = $text; }
/** * Article constructor. * * @param object $item The article */ public function __construct($item) { parent::__construct($item->title, $item->alias, new \stdClass()); $this->article = $item; }
/** * Image constructor. * * @param ImageEntity $item The location of the image file * @param string $alt The alternative description */ public function __construct(ImageEntity $item, $alt = '') { parent::__construct($item->caption, 'img-' . spl_object_hash($this), new \stdClass()); $this->image = $item; $this->alt = $alt; }
/** * Paragraph constructor. * * @param string $text The copy of the paragraph */ public function __construct($text) { parent::__construct('Span', 'span-' . spl_object_hash($this), new \stdClass()); $this->text = $text; }
/** * Icon constructor. * * @param $name */ public function __construct($name) { parent::__construct($name, 'icon-' . spl_object_hash($this), new \stdClass()); $this->name = $name; }
/** * DefaultMenu constructor. * * @param object $item The item to be displayed as a menu */ public function __construct($item) { parent::__construct('Menu', 'menu-' . spl_object_hash($this), new \stdClass()); $this->item = $item; }
/** * Attribution constructor. * * @param string $label The text before the author's name * @param string $name The author's name */ public function __construct($label, $name) { parent::__construct($label, 'lbl-' . spl_object_hash($this), new \stdClass()); $this->label = $label; $this->name = $name; }
/** * Headline constructor. * * @param string $text The copy of the headline * @param integer $level The Level of the headline */ public function __construct($text, $level = 1) { parent::__construct($text, 'headline-' . spl_object_hash($this), new \stdClass()); $this->text = $text; $this->level = $level; }
/** * Paragraph constructor. * * @param string $text The copy of the paragraph * @param integer $variant Emphasis variant, see class constants */ public function __construct($text, $variant = self::PLAIN) { parent::__construct('Paragraph', 'paragraph-' . spl_object_hash($this), new \stdClass()); $this->text = $text; $this->variant = $variant; }