ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
Card.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 2016 Amstutz Timon <timon.amstutz@ilub.unibe.ch> Extended GPL, see docs/LICENSE */
4
6
8use ILIAS\UI\Implementation\Component\ComponentHelper;
9
10class Card implements C\Card {
11 use ComponentHelper;
12
16 protected $title;
17
21 protected $header_section;
22
27
31 protected $image;
32
33
38 public function __construct($title, \ILIAS\UI\Component\Image\Image $image = null){
39 $this->checkStringArg("title", $title);
40
41 $this->title = $title;
42 $this->image = $image;
43 }
44
48 public function withTitle($title){
49 $this->checkStringArg("title", $title);
50
51 $clone = clone $this;
52 $clone->title = $title;
53
54 return $clone;
55 }
56
60 public function getTitle(){
61 return $this->title;
62 }
63
67 public function withImage(\ILIAS\UI\Component\Image\Image $image){
68 $clone = clone $this;
69 $clone->image = $image;
70 return $clone;
71 }
72
76 public function getImage(){
77 return $this->image;
78 }
79
83 public function withSections(array $sections){
84 $classes = [\ILIAS\UI\Component\Component::class];
85 $this->checkArgListElements("sections",$sections,$classes);
86
87 $clone = clone $this;
88 $clone->content_sections = $sections;
89 return $clone;
90 }
91
95 public function getSections(){
97 }
98}
99?>
An exception for terminatinating execution or to throw for unit testing.
withImage(\ILIAS\UI\Component\Image\Image $image)
Definition: Card.php:67
__construct($title, \ILIAS\UI\Component\Image\Image $image=null)
Definition: Card.php:38
A component is the most general form of an entity in the UI.
Definition: Component.php:13
Interface Card \UI\Component\Card.