ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
ILIAS\ResourceStorage\Flavour\Flavours Class Reference
+ Collaboration diagram for ILIAS\ResourceStorage\Flavour\Flavours:

Public Member Functions

 __construct (FlavourBuilder $flavour_builder, ResourceBuilder $resource_builder)
 
 get (ResourceIdentification $rid, FlavourDefinition $flavour_definition)
 Use get() to get a Flavour for the FlavourDefinition for a ResourceIdentification. More...
 
 ensure (ResourceIdentification $rid, FlavourDefinition $flavour_definition)
 Actually like get(), but without return and can be used to create Flavour before you want to get them. More...
 
 has (ResourceIdentification $rid, FlavourDefinition $flavour_definition)
 This can be used to ask whether a Flavor already exists for the FlavourDefinition for a certain IRSS ResourceIdentification. More...
 
 remove (ResourceIdentification $rid, FlavourDefinition $flavour_definition)
 You don't need a flavor anymore or you want to delete it because you explicitly want to regenerate it? Use delete for this More...
 
 possible (ResourceIdentification $rid, FlavourDefinition $flavour_definition)
 Hereby you can check in advance, if there is a Machine and an Engine for your FlavourDefinition, which can generate the Flavour you want. More...
 

Protected Attributes

FlavourBuilder $flavour_builder
 
ResourceBuilder $resource_builder
 

Detailed Description

Author
Fabian Schmid fabia.nosp@m.n@sr.nosp@m..solu.nosp@m.tion.nosp@m.s

Definition at line 29 of file Flavours.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\ResourceStorage\Flavour\Flavours::__construct ( FlavourBuilder  $flavour_builder,
ResourceBuilder  $resource_builder 
)

Definition at line 34 of file Flavours.php.

References ILIAS\ResourceStorage\Flavour\Flavours\$flavour_builder, and ILIAS\ResourceStorage\Flavour\Flavours\$resource_builder.

Referenced by ILIAS\ResourceStorage\Flavours\FlavourMachineTest\createSVGColorChangeDefinition().

37  {
38  $this->flavour_builder = $flavour_builder;
39  $this->resource_builder = $resource_builder;
40  }
+ Here is the caller graph for this function:

Member Function Documentation

◆ ensure()

ILIAS\ResourceStorage\Flavour\Flavours::ensure ( ResourceIdentification  $rid,
FlavourDefinition  $flavour_definition 
)

Actually like get(), but without return and can be used to create Flavour before you want to get them.

Definition at line 59 of file Flavours.php.

59  : void
60  {
61  if ($this->flavour_builder->has($rid, $flavour_definition)) {
62  return;
63  }
64  $this->flavour_builder->get($rid, $flavour_definition, true);
65  }

◆ get()

ILIAS\ResourceStorage\Flavour\Flavours::get ( ResourceIdentification  $rid,
FlavourDefinition  $flavour_definition 
)

Use get() to get a Flavour for the FlavourDefinition for a ResourceIdentification.

If the Flavour already exists you will get it, if not it will be created and returned directly.

Take into account that a Flavour can come back without Tokens for accessing the streams of the Flavour, namely if the Flavour does not contain any Streams. You will usually use the flavor with the Consumers of the IRSS anyway, so you don't have to worry about that.

Definition at line 51 of file Flavours.php.

51  : Flavour
52  {
53  return $this->flavour_builder->get($rid, $flavour_definition, false);
54  }

◆ has()

ILIAS\ResourceStorage\Flavour\Flavours::has ( ResourceIdentification  $rid,
FlavourDefinition  $flavour_definition 
)

This can be used to ask whether a Flavor already exists for the FlavourDefinition for a certain IRSS ResourceIdentification.

Definition at line 71 of file Flavours.php.

Referenced by ILIAS\ResourceStorage\Flavour\Flavours\remove().

71  : bool
72  {
73  return $this->flavour_builder->has($rid, $flavour_definition);
74  }
+ Here is the caller graph for this function:

◆ possible()

ILIAS\ResourceStorage\Flavour\Flavours::possible ( ResourceIdentification  $rid,
FlavourDefinition  $flavour_definition 
)

Hereby you can check in advance, if there is a Machine and an Engine for your FlavourDefinition, which can generate the Flavour you want.

Definition at line 93 of file Flavours.php.

93  : bool
94  {
95  return $this->flavour_builder->testDefinition($rid, $flavour_definition);
96  }

◆ remove()

ILIAS\ResourceStorage\Flavour\Flavours::remove ( ResourceIdentification  $rid,
FlavourDefinition  $flavour_definition 
)

You don't need a flavor anymore or you want to delete it because you explicitly want to regenerate it? Use delete for this

Definition at line 81 of file Flavours.php.

References ILIAS\ResourceStorage\Flavour\Flavours\has().

81  : void
82  {
83  if ($this->has($rid, $flavour_definition)) {
84  $this->flavour_builder->delete($rid, $flavour_definition);
85  }
86  }
has(ResourceIdentification $rid, FlavourDefinition $flavour_definition)
This can be used to ask whether a Flavor already exists for the FlavourDefinition for a certain IRSS ...
Definition: Flavours.php:71
+ Here is the call graph for this function:

Field Documentation

◆ $flavour_builder

◆ $resource_builder

ResourceBuilder ILIAS\ResourceStorage\Flavour\Flavours::$resource_builder
protected

Definition at line 32 of file Flavours.php.

Referenced by ILIAS\ResourceStorage\Flavour\Flavours\__construct().


The documentation for this class was generated from the following file: