ILIAS  release_7 Revision v7.30-3-g800a261c036
Avatar.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 2017 Nils Haagen <nils.haagen@concepts-and-training.de> Extended GPL, see docs/LICENSE */
3
5
9
10abstract class Avatar implements C\Symbol\Avatar\Avatar
11{
17 private $username;
18
19 protected $alternative_text = "";
20
21 public function __construct(string $username)
22 {
23 $this->username = $username;
24 }
25
29 public function getUsername() : string
30 {
31 return $this->username;
32 }
33
34 public function withAlternativeText(string $text) : C\Symbol\Avatar\Avatar
35 {
36 $clone = clone $this;
37 $clone->alternative_text = $text;
38 return $clone;
39 }
40
41 public function getAlternativeText() : string
42 {
44 }
45}
An exception for terminatinating execution or to throw for unit testing.
trait JavaScriptBindable
Trait for components implementing JavaScriptBindable providing standard implementation.
trait ComponentHelper
Provides common functionality for component implementations.