---
title: "AccessLog – API-Referenz · Quittio"
description: "Records which view model fields a template read (for the mandatory field guard)."
canonical_url: "https://quittio.dev/docs/api/Quittio/Core/View/AccessLog"
locale: de
meta:
  "og:description": "Records which view model fields a template read (for the mandatory field guard)."
  "og:image": "https://quittio.dev/og/quittio-de.jpg"
  "og:image:alt": "Quittio: E-Rechnungen für PHP und Laravel. Rechtssicher, validiert, archiviert, mit geprüfter Beispielrechnung."
  "og:image:height": "630"
  "og:image:type": image/jpeg
  "og:image:width": "1200"
  "og:title": "AccessLog – API-Referenz · Quittio"
  "twitter:image": "https://quittio.dev/og/quittio-de.jpg"
  "twitter:image:alt": "Quittio: E-Rechnungen für PHP und Laravel. Rechtssicher, validiert, archiviert, mit geprüfter Beispielrechnung."
---

> Index of every page on this site: [llms.txt](https://quittio.dev/llms.txt)

[API reference](https://quittio.dev/docs/api) / [Quittio](https://quittio.dev/docs/api/Quittio) \\ [Core](https://quittio.dev/docs/api/Quittio/Core) \\ [View](https://quittio.dev/docs/api/Quittio/Core/View)

# AccessLog

final class in quittio/core

`Quittio\Core\View\AccessLog` · [Source](https://github.com/Quittio/quittio/blob/v0.7.1/packages/core/src/View/AccessLog.php#L17)

Records which view model fields a template read (for the mandatory field guard).

Only leaf values that are not null (scalars, formatted values) are recorded, so counting or iterating a list does not count as printing it. Paths may contain "\[\*]": for `self::accessed()` it matches any list index, `self::expand()` lists every index.

Aliases map one view model node onto another, e.g. "issuer" onto "seller": a template that prints $invoice->issuer->address has printed the seller's address.

## Methods \#

| Method | Description |
| --- | --- |
| `->accessed()` | Whether $path or any field below it was read. |
| `->all()` | |
| `->bind()` | The view model data the paths refer to, for {@see self::expand()}. |
| `->expand()` | The concrete paths of $pattern that hold a value (not null, not an empty list) in the bound data; "\[\*]" expands to every index, e.g. "vatRows\[\*].amount" to \["vatRows\[0].amount", "vatRows\[1].amount"]. |
| `->hasData()` | |
| `->record()` | |
| `->reset()` | |

### `accessed()`#

```
public function accessed(string $path): bool
```

Whether $path or any field below it was read.

| Parameter | Type | Description |
| --- | --- | --- |
| `$path` | `string` | |

<dl><dt>Returns</dt>
<dd><code>bool</code></dd>
</dl>

### `all()`#

```
public function all(): list<string>
```

<dl><dt>Returns</dt>
<dd><code>list&lt;string&gt;</code></dd>
</dl>

### `bind()`#

```
public function bind(
    array<string|int, mixed> $data,
    array<string, string> $aliases = [],
): void
```

The view model data the paths refer to, for {@see self::expand()}.

| Parameter | Type | Description |
| --- | --- | --- |
| `$data` | `array<string\|int, mixed>` | |
| `$aliases` | `array<string, string>` = `[]` | path prefix => path prefix it stands for |

### `expand()`#

```
public function expand(string $pattern): list<string>
```

The concrete paths of $pattern that hold a value (not null, not an empty list) in the bound data; "\[\*]" expands to every index, e.g. "vatRows\[\*].amount" to \["vatRows\[0].amount", "vatRows\[1].amount"].

| Parameter | Type | Description |
| --- | --- | --- |
| `$pattern` | `string` | |

<dl><dt>Returns</dt>
<dd><code>list&lt;string&gt;</code></dd>
</dl>

### `hasData()`#

```
public function hasData(): bool
```

<dl><dt>Returns</dt>
<dd><code>bool</code></dd>
</dl>

### `record()`#

```
public function record(string $path): void
```

| Parameter | Type | Description |
| --- | --- | --- |
| `$path` | `string` | |

### `reset()`#

```
public function reset(): void
```

```json
{"@context":"https://schema.org","@graph":[{"@id":"https://quittio.dev/#website","@type":"WebSite","description":"E-Rechnungen für PHP und Laravel: ZUGFeRD, XRechnung und Peppol erstellen, prüfen, lesen und archivieren.","inLanguage":"de-DE","name":"Quittio","url":"https://quittio.dev/","publisher":{"@id":"https://quittio.dev/#identity"},"workTranslation":{"@id":"https://quittio.dev/en#website"}},{"@id":"https://quittio.dev/docs/api/Quittio/Core/View/AccessLog#webpage","@type":"WebPage","description":"Records which view model fields a template read (for the mandatory field guard).","name":"AccessLog – API-Referenz","url":"https://quittio.dev/docs/api/Quittio/Core/View/AccessLog","isPartOf":{"@id":"https://quittio.dev/#website"},"potentialAction":[{"@type":"ReadAction","target":["https://quittio.dev/docs/api/Quittio/Core/View/AccessLog"]}],"primaryImageOfPage":{"@id":"https://quittio.dev/#logo"}},{"@id":"https://quittio.dev/#identity","@type":"Organization","description":"Open-Source-Bibliothek für E-Rechnungen in PHP und Laravel (ZUGFeRD, XRechnung, Peppol) und Quittio Managed.","email":"kontakt@niklasforst.de","legalName":"Niklas Forst – Softwareentwicklung","name":"Quittio","url":"https://quittio.dev","founder":{"@type":"Person","name":"Niklas Forst","url":"https://quittio.dev/ueber"},"logo":{"@id":"https://quittio.dev/#logo"},"sameAs":["https://github.com/Quittio/quittio","https://packagist.org/packages/quittio/quittio"]},{"@id":"https://quittio.dev/#logo","@type":"ImageObject","caption":"Quittio","contentUrl":"https://quittio.dev/logo.png","inLanguage":"de-DE","url":"https://quittio.dev/logo.png"}]}
```