> ## Documentation Index
> Fetch the complete documentation index at: https://docs.law4devs.eu/llms.txt
> Use this file to discover all available pages before exploring further.

# Frameworks

> List and retrieve EU regulatory frameworks with the Law4Devs PHP SDK.

## Overview

Frameworks represent EU regulations such as GDPR, CRA, NIS2, and the AI Act. Use `$client->frameworks` to list and fetch them.

***

## Methods

### `list()`

Returns a page of all available frameworks.

```php theme={null}
$page = $client->frameworks->list();

printf("Found %d frameworks\n", $page->meta->total);
foreach ($page->data as $fw) {
    printf("  %-12s %s\n", $fw->slug, $fw->name);
}
```

**Returns** `Page<FrameworkSummary>`

***

### `get()`

Fetch a single framework by slug, including detailed counts.

```php theme={null}
$cra = $client->frameworks->get('cra');

echo $cra->name . "\n";               // Cyber Resilience Act
echo $cra->celexNumber . "\n";        // 32024R2847
echo $cra->articleCount . " articles\n";
```

**Parameters**

| Parameter | Type     | Description                   |
| --------- | -------- | ----------------------------- |
| `$slug`   | `string` | Framework slug, e.g. `'gdpr'` |

**Returns** `Framework`

***

### `iter()`

Iterate over all frameworks across all pages.

```php theme={null}
foreach ($client->frameworks->iter() as $fw) {
    echo $fw->slug . ': ' . $fw->name . "\n";
}
```

**Returns** `\Generator<FrameworkSummary>`

***

## Models

### `FrameworkSummary`

Returned by `list()` and `iter()`.

| Field          | Type           | Description                              |
| -------------- | -------------- | ---------------------------------------- |
| `id`           | `int`          | Internal numeric ID                      |
| `slug`         | `string`       | URL-safe identifier, e.g. `'cra'`        |
| `name`         | `string`       | Full framework name                      |
| `shortName`    | `string`       | Short name, e.g. `'CRA'`                 |
| `celexNumber`  | `string`       | EUR-Lex CELEX identifier                 |
| `description`  | `string\|null` | Brief description                        |
| `isActive`     | `bool`         | Whether data is actively maintained      |
| `status`       | `string`       | `'active'`, `'draft'`, or `'superseded'` |
| `articleCount` | `int`          | Number of synced articles                |
| `recitalCount` | `int`          | Number of synced recitals                |
| `createdAt`    | `string`       | ISO 8601 creation timestamp              |

### `Framework`

Returned by `get()`. Extends `FrameworkSummary` with:

| Field              | Type          | Description                       |
| ------------------ | ------------- | --------------------------------- |
| `eurLexUrl`        | `string`      | Link to the official EUR-Lex page |
| `requirementCount` | `int`         | Number of extracted requirements  |
| `annexCount`       | `int`         | Number of annexes                 |
| `tagCount`         | `int`         | Number of associated tags         |
| `coverage`         | `array\|null` | Coverage statistics               |

***

## Examples

### List all active frameworks

```php theme={null}
foreach ($client->frameworks->iter() as $fw) {
    if ($fw->isActive) {
        printf("%-12s %s (%d articles)\n", $fw->slug, $fw->name, $fw->articleCount);
    }
}
```

### Find frameworks with full article coverage

```php theme={null}
$page = $client->frameworks->list();

foreach ($page->data as $fw) {
    if ($fw->expectedArticles > 0 && $fw->articleCount >= $fw->expectedArticles) {
        echo $fw->name . " — fully synced\n";
    }
}
```
