# technique102/bitrix-events-attributes architecture

> Architecture diagram of the GitHub repository technique102/bitrix-events-attributes, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/technique102/bitrix-events-attributes
- Repository: https://github.com/technique102/bitrix-events-attributes

## Overview

##### Core Components
- EventManager (Central Component)
- EventHandler Attribute
- ModuleSettingsService

##### Integration Points
- 1C-Bitrix Core (External System)
- Bitrix EventManager (External Component)
- PHP 8 Attributes System

##### Component Relationships
- EventHandler attribute connecting to user-defined handler classes
- ModuleSettingsService interaction with module configuration files

##### Specific Elements

- Rectangle: EventManager (Core)
- Hexagon: EventHandler Attribute
- Cloud: Bitrix System
- Rounded Rectangle: User Handler Classes

- Registration Flow: Handler Classes → EventManager
- Configuration Flow: .settings.php → ModuleSettingsService
- Event Processing Flow: Bitrix Events → Handler Methods

##### Important Details to Highlight
- Attribute-based registration mechanism
- Multiple event binding capability
- Module settings integration
- Boot process flow

##### The initialization process
- How EventManager is instantiated
- Demonstrate handler class registration
- Boot process

##### Two registration paths
- Direct registration through addEventHandlerClass()
- Module settings-based registration

##### Event handling flow
- Event trigger from Bitrix
- Attribute processing
- Handler method execution

- Component types
- Special symbols

Remember to include version compatibility indicators (PHP 8+) and show the relationship with Composer for package management.

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles
    classDef core fill:#2374ab,color:#fff,stroke:#333
    classDef attribute fill:#ff7f50,color:#fff,stroke:#333
    classDef service fill:#4caf50,color:#fff,stroke:#333
    classDef external fill:#gray,color:#333,stroke:#666
    classDef user fill:#34a853,color:#fff,stroke:#333
    classDef config fill:#ff9800,color:#fff,stroke:#333

    %% External Systems
    subgraph ExternalSystems
        BitrixCore["1C-Bitrix Core"]:::external
        BitrixEM["Bitrix EventManager"]:::external
        PHP8["PHP 8+ Runtime"]:::external
    end

    %% Package Layer
    subgraph PackageCore
        EM["EventManager"]:::core
        EHA["EventHandler Attribute"]:::attribute
        MSS["ModuleSettingsService"]:::service
    end

    %% Application Layer
    subgraph AppLayer
        UHC["User Handler Classes"]:::user
        ModConfig[".settings.php"]:::config
    end

    %% Relationships
    BitrixCore --> BitrixEM
    PHP8 --> EHA
    BitrixEM --> EM
    EHA --> EM
    UHC --> EHA
    ModConfig --> MSS
    MSS --> EM
    EM --> BitrixEM

    %% Legend
    subgraph Legend
        L1["Core Components"]:::core
        L2["Attributes"]:::attribute
        L3["Services"]:::service
        L4["External Systems"]:::external
        L5["User Components"]:::user
        L6["Configuration"]:::config
    end

    %% Click Events
    click EM "https://github.com/Technique102/bitrix-events-attributes/blob/main/src/EventManager.php"
    click EHA "https://github.com/Technique102/bitrix-events-attributes/blob/main/src/Attributes/EventHandler.php"
    click MSS "https://github.com/Technique102/bitrix-events-attributes/blob/main/src/Services/ModuleSettingsService.php"
    click EHA "https://github.com/Technique102/bitrix-events-attributes/tree/main/src/Attributes/"
    click MSS "https://github.com/Technique102/bitrix-events-attributes/tree/main/src/Services/"
```
