ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
Deck.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 Deck implements D\Deck {
11 use ComponentHelper;
12
16 protected $cards;
17
21 protected $size;
27 public function __construct($cards, $size){
28 $classes = [\ILIAS\UI\Component\Card\Card::class];
29 $this->checkArgListElements("cards",$cards,$classes);
30 $this->checkArgIsElement("size", $size, self::$sizes, "size type");
31
32 $this->cards = $cards;
33 $this->size = $size;
34 }
35
39 public function withCards($cards){
40 $classes = [\ILIAS\UI\Component\Card\Card::class];
41 $this->checkArgListElements("sections",$cards,$classes);
42
43 $clone = clone $this;
44 $clone->cards = $cards;
45 return $clone;
46 }
47
51 public function getCards(){
52 return $this->cards;
53 }
54
58 public function withCardsSize($size){
59 $this->checkArgIsElement("size", $size, self::$sizes, "size type");
60
61 $clone = clone $this;
62 $clone->size = $size;
63 return $clone;
64 }
65
69 public function getCardsSize(){
70 return $this->size;
71 }
72
73 private static $sizes = array
74 (self::SIZE_FULL
75 , self::SIZE_XL
76 , self::SIZE_L
77 , self::SIZE_M
78 , self::SIZE_S
79 , self::SIZE_XS
80 );
81}
An exception for terminatinating execution or to throw for unit testing.
__construct($cards, $size)
Deck constructor.
Definition: Deck.php:27
withCardsSize($size)
Set the cards size.Deck
Definition: Deck.php:58
getCardsSize()
Get the cards size.int
Definition: Deck.php:69
withCards($cards)
Set the cards to be displayed in the deck.Deck
Definition: Deck.php:39
font size
Definition: langcheck.php:162