ILIAS  trunk Revision v11.0_alpha-1831-g8615d53dadb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ILIAS\ResourceStorage\IRSSEventLogObserver Class Reference
+ Inheritance diagram for ILIAS\ResourceStorage\IRSSEventLogObserver:
+ Collaboration diagram for ILIAS\ResourceStorage\IRSSEventLogObserver:

Public Member Functions

 __construct (private \ilLogger $logger)
 
 getId ()
 Unique identifier of the implementing event-listener. More...
 
 update (Event $event, ?Data $data)
 
 updateFailed (\Throwable $e, Event $event, ?Data $data)
 
- Public Member Functions inherited from ILIAS\ResourceStorage\Events\Observer
 update (Event $event, ?Data $data)
 Recieves an event and handles it appropriately. More...
 
 updateFailed (\Throwable $e, Event $event, ?Data $data)
 Is called if your update method failed (Exception, Throwable). More...
 

Private Member Functions

 appendData (string $to_message, ?Data $data=null)
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ILIAS\ResourceStorage\IRSSEventLogObserver::__construct ( private \ilLogger  $logger)

Definition at line 30 of file IRSSEventLogObserver.php.

31  {
32  }

Member Function Documentation

◆ appendData()

ILIAS\ResourceStorage\IRSSEventLogObserver::appendData ( string  $to_message,
?Data  $data = null 
)
private

Definition at line 39 of file IRSSEventLogObserver.php.

References $data.

Referenced by ILIAS\ResourceStorage\IRSSEventLogObserver\update().

39  : string
40  {
41  return $to_message . ': ' . ($data ? json_encode($data->getArrayCopy()) : '');
42  }
+ Here is the caller graph for this function:

◆ getId()

ILIAS\ResourceStorage\IRSSEventLogObserver::getId ( )

Unique identifier of the implementing event-listener.

e.g. FQCN

Implements ILIAS\ResourceStorage\Events\Observer.

Definition at line 34 of file IRSSEventLogObserver.php.

34  : string
35  {
36  return self::class;
37  }

◆ update()

ILIAS\ResourceStorage\IRSSEventLogObserver::update ( Event  $event,
?Data  $data 
)

Definition at line 45 of file IRSSEventLogObserver.php.

References ILIAS\ResourceStorage\IRSSEventLogObserver\appendData(), ILIAS\ResourceStorage\Events\FLAVOUR_BUILD_FAILED, and ILIAS\Repository\logger().

45  : void
46  {
47  match ($event->value) {
48  Event::COLLECTION_RESOURCE_ADDED => $this->logger->info($this->appendData("Collection resource added", $data)),
49  Event::FLAVOUR_BUILD_SUCCESS => $this->logger->info($this->appendData("Flavour build success", $data)),
50  Event::FLAVOUR_BUILD_FAILED => $this->logger->warning($this->appendData("Flavour build failed", $data)),
51  default => $this->logger->debug($this->appendData($event->value, $data))
52  };
53  }
appendData(string $to_message, ?Data $data=null)
event string being used if a new Resource has been stored to the IRSS.
Definition: Event.php:52
+ Here is the call graph for this function:

◆ updateFailed()

ILIAS\ResourceStorage\IRSSEventLogObserver::updateFailed ( \Throwable  $e,
Event  $event,
?Data  $data 
)

Definition at line 55 of file IRSSEventLogObserver.php.

55  : void
56  {
57  // nothing to do
58  }

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