ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
class.ilObjectTileImageFlavourDefinition.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
24 
26 {
27  private const ID = '5ae5cfe34279f9edfade75fdec92ad55757dfe4fc99722a32dc53cc3d7c72fe4';
28 
29  private int $quality = 70;
30 
31  private array $widths = [
32  'xl' => 1920,
33  'l' => 960,
34  'm' => 480,
35  's' => 240,
36  'xs' => 120
37  ];
38 
39  private float $ratio = 3 / 2;
40 
41  public function __construct(
42  ) {
43  }
44 
45  public function getId(): string
46  {
47  return self::ID;
48  }
49 
50  public function getFlavourMachineId(): string
51  {
53  }
54 
55  public function getInternalName(): string
56  {
57  return 'object_tile_image';
58  }
59 
60  public function getVariantName(): ?string
61  {
62  return json_encode([
63  'width' => $this->widths,
64  'ratio' => $this->ratio,
65  'quality' => $this->quality
66  ]);
67  }
68 
69  public function persist(): bool
70  {
71  return true;
72  }
73 
74  public function getWidths(): array
75  {
76  return $this->widths;
77  }
78 
79  public function getRatio(): float
80  {
81  return $this->ratio;
82  }
83 
84  public function getQuality(): int
85  {
86  return $this->quality;
87  }
88 }
getInternalName()
This defines the speaky internal name of the definition, as the consumer would like to use it...
persist()
Define whether the generated flavor and the respective streams should be persisted, or whether they should only be generated and used in-memory.