ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
Flavour.php
Go to the documentation of this file.
1 <?php
18 declare(strict_types=1);
19 
21 
27 
31 class Flavour
32 {
33  private array $streams = [];
34  private array $stream_resolvers = [];
37  private int $revision;
38 
39  public function __construct(FlavourDefinition $definition, ResourceIdentification $resource_id, int $revision)
40  {
41  $this->definition = $definition;
42  $this->resource_id = $resource_id;
43  $this->revision = $revision;
44  }
45 
51  public function getPersistingName(): string
52  {
53  return hash('crc32', $this->getName());
54  }
55 
56  public function getName(): string
57  {
58  return $this->definition->getInternalName() . $this->definition->getVariantName();
59  }
60 
62  {
63  return $this->resource_id;
64  }
65 
66  public function withStreamResolver(int $index, ?StreamResolver $stream_resolver = null): Flavour
67  {
68  $this->stream_resolvers[$index] = $stream_resolver;
69 
70  return $this;
71  }
72 
73  public function maybeStreamResolver(int $index): ?StreamResolver
74  {
75  return $this->stream_resolvers[$index] ?? null;
76  }
77 
81  public function getStreamResolvers(): array
82  {
84  }
85 
86  public function getDefinition(): FlavourDefinition
87  {
88  return $this->definition;
89  }
90 
91  public function getRevision(): int
92  {
93  return $this->revision;
94  }
95 }
Token
The string representation of these tokens must not occur in the names of metadata elements...
Definition: Token.php:27
withStreamResolver(int $index, ?StreamResolver $stream_resolver=null)
Definition: Flavour.php:66
ResourceIdentification $resource_id
Definition: Flavour.php:36
getPersistingName()
Flavours are stored in the file system by the StroageHandler.
Definition: Flavour.php:51
__construct(FlavourDefinition $definition, ResourceIdentification $resource_id, int $revision)
Definition: Flavour.php:39