---
title: "Class reference"
manual: "Fixpunkt Social Bridge"
version: "1.6"
permalink: "https://docs.typo3.org/permalink/fixpunkt/fp-social-bridge:reference@1.6"
source: "Reference/Index.rst"
rendered: "2026-10-20T09:16:49+00:00"
---

# Class reference {#reference}

All classes live in the `Fixpunkt\FpSocialBridge` namespace. They fall into
three types:

-   **Interface** – the shared serialization contract.
-   **DTOs** (data transfer objects) – the plain data carriers.
-   **Responses** – the typed response objects of the social server.

-   [Interface](https://docs.typo3.org/permalink/fixpunkt/fp-social-bridge:interface@1.6)
-   [DTOs](https://docs.typo3.org/permalink/fixpunkt/fp-social-bridge:dtos@1.6)
-   [Responses](https://docs.typo3.org/permalink/fixpunkt/fp-social-bridge:responses@1.6)

## Interface {#interface}

### SerializableInterface {#reference-serializable-interface}

Shared contract of all data-transfer and response objects.

| Method | Description |
| --- | --- |
| `fromJson(string $json): static` | Creates an object from a JSON string. |
| `fromArray(array $data): static` | Creates an object from an associative array. |
| `toArray(): array` | Serializes the object back into an array. |

## DTOs {#dtos}

The data transfer objects in the `v2\Data` namespace contain only data and
accessor methods, no business logic.

### v2\\Data\\Post {#reference-post}

Represents a single post.

| Method | Return value |
| --- | --- |
| `getId()` | `string` – unique ID of the post |
| `getHeadline()` | `string` – headline (empty for many sources) |
| `getMessage()` | `string` – message text as HTML (may contain `<br />`/`<a>` as well as emoji placeholders `{emoji:…}`) |
| `getPostUrl()` | `string` – URL of the post on the network |
| `getLink()` | `string` – linked URL |
| `getUpdateTime()` | `\DateTime` – time of last update (in JSON as `date` / `timezone_type` / `timezone`) |
| `getHashtags()` | `array` – hashtags as strings **without** a leading `#` |
| `getMentions()` | `array` – mentions as objects with `displayName` and `systemName` |
| `getPictures()` | `array` – picture URLs |

### v2\\Data\\Posts {#reference-posts}

Iterable, countable collection of `Post` objects. Implements `Iterator` and
`Countable`, so it can be used directly with `foreach` and `count()`.

### v2\\Data\\Channel {#reference-channel}

A selectable page or channel of a connected account. This is exactly what the
client side writes into the `channel` and `label` fields of an account
record.

| Method | Return value |
| --- | --- |
| `getId()` | `string` – id of the page/channel in the network |
| `getName()` | `string` – display name of the page/channel |

### v2\\Data\\Account {#reference-account}

A single connected account of the social server.

| Method | Return value |
| --- | --- |
| `getUid()` | `int` – uid of the access key record on the social server |
| `getNetwork()` | `string` – connector class name, e.g. `Fixpunkt\FpSocialServer\Networks\Facebook\Connector` |
| `getNetworkKey()` | `string` – short form of the network (`facebook`, `instagram`, `instagramlogin`, `linkedin`) |
| `getNetworkName()` | `string` – human readable network name, e.g. `Instagram (Direktanmeldung)` |
| `getDisplayName()` | `string` – name of the account as shown to the user |
| `getUsername()` | `string` – identifier of the account within the network |
| `getEmail()` | `string` – e-mail address, may be empty |
| `getExpires()` | `\DateTime\|null` – expiry of the access key, `null` for networks whose keys do not expire |
| `getExpired()` | `bool` – whether the access key has already expired |
| `getChannels()` | `Channel[]` – the pages/channels reachable with this account |

### v2\\Data\\Accounts {#reference-accounts}

Iterable, countable collection of `Account` objects, **grouped by network**.
Unlike [Posts](https://docs.typo3.org/permalink/fixpunkt/fp-social-bridge:reference-posts@1.6) it is not a flat list: iterating yields
the network class name as key and an `Account[]` as value.

| Method | Description |
| --- | --- |
| `getIterator()` | Iterates `network => Account[]` (`IteratorAggregate`) |
| `count()` | Total number of accounts across all networks |
| `getNetworks()` | `string[]` – the networks that have accounts |
| `getByNetwork(string $network)` | `Account[]` – the accounts of one network, empty if unknown |
| `getAll()` | `Account[]` – all accounts as a flat list |

## Responses {#responses}

The response objects in the `v2\Response` namespace represent the various
response types of the social server. The base class factory turns a received
JSON response into the matching object.

### v2\\Response\\SocialServerResponse {#reference-social-server-response}

Abstract base class of all server responses.

| Method | Description |
| --- | --- |
| `fromJson(string $json): static` | Factory: checks the protocol version and returns the matching response object. A mismatching version yields a [SocialServerVersionMismatchResponse](https://docs.typo3.org/permalink/fixpunkt/fp-social-bridge:reference-version-mismatch-response@1.6), an unknown type a [SocialServerUnrecognizedResponse](https://docs.typo3.org/permalink/fixpunkt/fp-social-bridge:reference-unrecognized-response@1.6). Throws an `\Exception` only on corrupted data (code `1684785549`). |
| `getVersion(): int` | Protocol version of the response. |

### v2\\Response\\SocialServerPostResponse {#reference-post-response}

Response containing a single post.

-   `getPost(): Post` – returns the contained post.

### v2\\Response\\SocialServerPostsResponse {#reference-posts-response}

Response containing multiple posts including pagination.

| Method | Description |
| --- | --- |
| `getPosts(): Posts` | Collection of the contained posts. |
| `getNext(): string` | Cursor for the next page (`nextPage`). |
| `getPrevious(): string` | Cursor for the previous page (`previousPage`). |

### v2\\Response\\SocialServerAccountsResponse {#reference-accounts-response}

Response containing all accounts the authenticated user has connected on the
social server, grouped by network.

-   `getAccounts(): Accounts` – the contained collection.

### v2\\Response\\SocialServerErrorResponse {#reference-error-response}

Error response of the social server.

| Method | Description |
| --- | --- |
| `getCode(): int` | Composite error code (prefix `5550`). |
| `getMessage(): string` | Error message. |

### v2\\Response\\SocialServerRateLimitResponse {#reference-rate-limit-response}

Response of the social server when a request limit has been reached. Extends
[SocialServerErrorResponse](https://docs.typo3.org/permalink/fixpunkt/fp-social-bridge:reference-error-response@1.6), so `getCode()` and
`getMessage()` are available as well – `getCode()` always returns
`55501788307200`, and `getMessage()` already spells out the point in time from
which the service can be used again.

| Method | Description |
| --- | --- |
| `getRetryAfter(): \DateTimeImmutable` | Point in time from which requests are allowed again, in the local time zone. |
| `getRetryAfterTimestamp(): int` | The same point in time as a unix timestamp. |
| `getRetryAfterSeconds(): int` | Seconds until then. Suitable for a `Retry-After` header or a wait before retrying. |
| `getLimit(): int` | Number of requests allowed within the interval. |
| `getInterval(): string` | The interval of the limit, e.g. `1 minute`. |
| `getScope(): string` | Which limit was hit: `profile` for requests to the same social media profile, `general` for the overall limit. |

### v2\\Response\\SocialServerVersionMismatchResponse {#reference-version-mismatch-response}

Response whose protocol version does not fit the expected one. Extends
[SocialServerErrorResponse](https://docs.typo3.org/permalink/fixpunkt/fp-social-bridge:reference-error-response@1.6); `getCode()` always
returns `55501652117309` and `getMessage()` names both versions.

| Method | Description |
| --- | --- |
| `getExpectedVersion(): int` | Protocol version that was expected (currently `2`). |
| `getReceivedVersion(): int` | Protocol version the answer was delivered with. Identical to `getVersion()`. |

### v2\\Response\\SocialServerUnrecognizedResponse {#reference-unrecognized-response}

Response whose type is unknown and that carries neither `code` nor `message`.
Extends [SocialServerErrorResponse](https://docs.typo3.org/permalink/fixpunkt/fp-social-bridge:reference-error-response@1.6);
`getCode()` always returns `55501741293955`.

| Method | Description |
| --- | --- |
| `getReceivedType(): string` | The type the answer stated, or an empty string if it did not carry one. |
| `getPayload(): array` | Raw data of the answer, e.g. for the log. |
