ILIAS  trunk Revision v11.0_alpha-1749-g1a06bdef097
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
Avatar.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
23 use ILIAS\UI\Component as C;
26 
27 abstract class Avatar implements C\Symbol\Avatar\Avatar
28 {
29  use ComponentHelper;
31 
32  private string $username;
33  protected string $label = '';
34 
35  public function __construct(string $username)
36  {
37  $this->username = $username;
38  }
39 
40  public function getUsername(): string
41  {
42  return $this->username;
43  }
44 
45  public function withLabel(string $text): C\Symbol\Avatar\Avatar
46  {
47  $clone = clone $this;
48  $clone->label = $text;
49  return $clone;
50  }
51 
52  public function getLabel(): string
53  {
54  return $this->label;
55  }
56 }
trait JavaScriptBindable
Trait for components implementing JavaScriptBindable providing standard implementation.