ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ILIAS\ResourceStorage\Flavours\DummyMachine Class Reference
+ Inheritance diagram for ILIAS\ResourceStorage\Flavours\DummyMachine:
+ Collaboration diagram for ILIAS\ResourceStorage\Flavours\DummyMachine:

Public Member Functions

 load (string $id, string $can_handle_definition_id=null, string $depends_on_engine=NoEngine::class)
 
 __construct ()
 FlavourMachines must be able to be created without further dependencies. More...
 
 getId ()
 
 canHandleDefinition (FlavourDefinition $definition)
 Check if a corresponding configuration can be processed by this Machine. More...
 
 dependsOnEngine ()
 Return the class name of the Engine that is required for this Machine to work. More...
 
 processStream (FileInformation $information, FileStream $stream, FlavourDefinition $for_definition)
 
- Public Member Functions inherited from ILIAS\ResourceStorage\Flavour\Machine\DefaultMachines\AbstractMachine
 __construct ()
 FlavourMachines must be able to be created without further dependencies. More...
 
 withEngine (Engine $engine)
 The demanded Engine will be passed here. More...
 
 getEngine ()
 

Private Attributes

string $depends_on_engine = NoEngine::class
 
string $id = self::class
 
string $can_handle_definition_id = null
 

Additional Inherited Members

- Protected Attributes inherited from ILIAS\ResourceStorage\Flavour\Machine\DefaultMachines\AbstractMachine
Engine $engine = null
 

Detailed Description

Definition at line 33 of file DummyMachine.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\ResourceStorage\Flavours\DummyMachine::__construct ( )

FlavourMachines must be able to be created without further dependencies.

Implements ILIAS\ResourceStorage\Flavour\Machine\FlavourMachine.

Definition at line 49 of file DummyMachine.php.

50  {
51  }

Member Function Documentation

◆ canHandleDefinition()

ILIAS\ResourceStorage\Flavours\DummyMachine::canHandleDefinition ( FlavourDefinition  $definition)

Check if a corresponding configuration can be processed by this Machine.

Implements ILIAS\ResourceStorage\Flavour\Machine\FlavourMachine.

Definition at line 58 of file DummyMachine.php.

References ILIAS\ResourceStorage\Flavour\Definition\FlavourDefinition\getId().

58  : bool
59  {
60  if ($this->can_handle_definition_id === null) {
61  return true;
62  }
63  return $this->can_handle_definition_id === $definition->getId();
64  }
+ Here is the call graph for this function:

◆ dependsOnEngine()

ILIAS\ResourceStorage\Flavours\DummyMachine::dependsOnEngine ( )

Return the class name of the Engine that is required for this Machine to work.

Returning null will result in a NullEngine passed to the Machine.

Implements ILIAS\ResourceStorage\Flavour\Machine\FlavourMachine.

Definition at line 66 of file DummyMachine.php.

References ILIAS\ResourceStorage\Flavours\DummyMachine\$depends_on_engine.

66  : ?string
67  {
69  }

◆ getId()

ILIAS\ResourceStorage\Flavours\DummyMachine::getId ( )
Returns
string max. 64 characters, MUST be unique and NOT a class-related magic-constant. E.g. you can generate a random one with $ php -r"echo hash('sha256', uniqid());" | pbcopy in your shell and paste string in your getId() implementation.

If you ever change the ID, FlavourDefinitions may no longer process anything with your machine that previously designated you as the processing machine.

Implements ILIAS\ResourceStorage\Flavour\Machine\FlavourMachine.

Definition at line 53 of file DummyMachine.php.

References ILIAS\ResourceStorage\Flavours\DummyMachine\$id.

53  : string
54  {
55  return $this->id;
56  }

◆ load()

ILIAS\ResourceStorage\Flavours\DummyMachine::load ( string  $id,
string  $can_handle_definition_id = null,
string  $depends_on_engine = NoEngine::class 
)

◆ processStream()

ILIAS\ResourceStorage\Flavours\DummyMachine::processStream ( FileInformation  $information,
FileStream  $stream,
FlavourDefinition  $for_definition 
)
Parameters
FileInformation$informationof the original File.
FileStream$streamof the original File.
FlavourDefinition$for_definitionthe definition for which the stream should be processed.
Returns
Result[]| For each "thing" that the machine generates, a result can be returned. E.g. when extracting 5 images from a PDF, 5 results are returned (Generator).

Implements ILIAS\ResourceStorage\Flavour\Machine\FlavourMachine.

Definition at line 72 of file DummyMachine.php.

76  : \Generator {
77  yield new NonStoreableResult($for_definition, $stream);
78  }

Field Documentation

◆ $can_handle_definition_id

string ILIAS\ResourceStorage\Flavours\DummyMachine::$can_handle_definition_id = null
private

Definition at line 37 of file DummyMachine.php.

Referenced by ILIAS\ResourceStorage\Flavours\DummyMachine\load().

◆ $depends_on_engine

string ILIAS\ResourceStorage\Flavours\DummyMachine::$depends_on_engine = NoEngine::class
private

◆ $id

string ILIAS\ResourceStorage\Flavours\DummyMachine::$id = self::class
private

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