ILIAS  trunk Revision v11.0_alpha-1749-g1a06bdef097
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
class.ilBadgePictureDefinition.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
24 {
25  private const ID = 'badge_image_resize_flavor';
26 
27  private int $quality = 50;
29  private array $widths = [
30  'xl' => 1920,
31  'l' => 960,
32  'm' => 480,
33  's' => 240,
34  'xs' => 120
35  ];
36 
37  public function getId(): string
38  {
39  return self::ID;
40  }
41 
42  public function getFlavourMachineId(): string
43  {
45  }
46 
47  public function getInternalName(): string
48  {
49  return 'badge_picture';
50  }
51 
52  public function getVariantName(): ?string
53  {
54  return json_encode([
55  'quality' => $this->quality,
56  'sizes' => $this->widths
57  ], JSON_THROW_ON_ERROR);
58  }
59 
60  public function persist(): bool
61  {
62  return true;
63  }
64 
65  public function getQuality(): int
66  {
67  return $this->quality;
68  }
69 
73  public function getWidths(): array
74  {
75  return $this->widths;
76  }
77 }
getVariantName()
If a definition can be used in several variants (e.g.
getInternalName()
This defines the speaky internal name of the definition, as the consumer would like to use it...
getFlavourMachineId()
Defines the ID of the machine that supports this definition.
persist()
Define whether the generated flavor and the respective streams should be persisted, or whether they should only be generated and used in-memory.