ILIAS  trunk Revision v11.0_alpha-1831-g8615d53dadb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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 32 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 48 of file DummyMachine.php.

49  {
50  }

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 57 of file DummyMachine.php.

References ILIAS\ResourceStorage\Flavour\Definition\FlavourDefinition\getId(), and null.

57  : bool
58  {
59  if ($this->can_handle_definition_id === null) {
60  return true;
61  }
62  return $this->can_handle_definition_id === $definition->getId();
63  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ 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 65 of file DummyMachine.php.

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

65  : ?string
66  {
68  }

◆ 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 52 of file DummyMachine.php.

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

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

◆ 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 71 of file DummyMachine.php.

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

Field Documentation

◆ $can_handle_definition_id

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

Definition at line 36 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: