CoolCMS API

ConnectionTypeInterface

A kind of external connection the system knows how to use (reCAPTCHA, maps…).

A connection is installed as a database row with this type's code; the type says which values it needs. Adding a new integration = one class implementing this interface plus the code that consumes it — no schema or admin changes.

Table of Contents

Methods

check()  : ConnectionCheck|null
Verifies the given values against the third party. Null = this type cannot be verified remotely.
getCode()  : string
Stable identifier stored in `cms_system_external_connections.type`.
getFields()  : array<int, ConnectionField>
getGroup()  : string|null
Connections of the same group are alternatives (e.g. `captcha`: reCAPTCHA v2 or v3) — only one of them should be enabled. Null = independent connection.
supportsCheck()  : bool
Can the credentials be verified remotely? Decides whether the administration offers the check.

Methods

check()

Verifies the given values against the third party. Null = this type cannot be verified remotely.

public check(array<string, scalar|null> $values) : ConnectionCheck|null
Parameters
$values : array<string, scalar|null>
Return values
ConnectionCheck|null

getCode()

Stable identifier stored in `cms_system_external_connections.type`.

public getCode() : string
Return values
string

getGroup()

Connections of the same group are alternatives (e.g. `captcha`: reCAPTCHA v2 or v3) — only one of them should be enabled. Null = independent connection.

public getGroup() : string|null
Return values
string|null

supportsCheck()

Can the credentials be verified remotely? Decides whether the administration offers the check.

public supportsCheck() : bool
Return values
bool
On this page

Search results