ExternalConnection
extends ExternalConnection
in package
External connection (third-party integrations: reCAPTCHA, maps, analytics ...).
A row is created by an "installation" (SQL), not by hand in the admin. type is the type
code (recaptcha_v2); the configuration fields of a type are defined by the type registry
in Core, this entity only stores them.
config is JSON text in the DB (long text) and always array<string, scalar|null> in PHP.
The column is held by the protected config property (a string); the public interface
(getConfig/setConfig) speaks arrays, so the hydrator (extract via getter, hydrate via
setter) keeps an array along the whole path Api -> wire -> Admin entity and back. The
configuration contains secret keys; Api read and write are for administrators only (RBAC).
Attributes
- #[Entity]
- #[Table]
- $name: 'cms_system_external_connections'
- #[TableAlias]
- 'externalConnection'
Table of Contents
Properties
- $config : string|null
- $enabled : bool
- $id : int|null
- $insertDatetime : DateTime
- $type : string
- $updateDatetime : DateTime|null
Methods
- __construct() : mixed
- callInitMethods() : void
- Calls `init{TraitName}()` for every used trait that defines such a method.
- getAllTraits() : array<string, string>
- Returns all traits the class uses, including those used by parent classes and nested traits.
- getConfig() : array<string, scalar|null>
- Invalid, empty or non-object JSON yields `[]`; non-scalar values are dropped.
- getId() : int|null
- getInsertDatetime() : DateTime
- getType() : string
- getUpdateDatetime() : DateTime|null
- isEnabled() : bool
- isPersisted() : bool
- setConfig() : $this
- setEnabled() : $this
- setId() : $this
- setInsertDatetime() : $this
- setType() : $this
- setUpdateDatetime() : $this
- getTraitsRecursive() : array<string, string>
- Walks the trait list recursively and collects nested traits too.
Properties
$config
protected
string|null
$config
= null
Attributes
- #[Column]
- $name: 'config'
- $type: 'text'
- $length: 4294967295
- $nullable: true
$enabled
protected
bool
$enabled
= false
Attributes
- #[Column]
- $name: 'enabled'
- $type: 'boolean'
- $options: ['default' => false]
$id
protected
int|null
$id
= null
Attributes
- #[Column]
- $name: 'connection_id'
- $type: 'integer'
- $options: ['unsigned' => true]
- #[GeneratedValue]
- #[Id]
$insertDatetime
protected
DateTime
$insertDatetime
= new DateTime()
Attributes
- #[Column]
- $name: 'insert_datetime'
- $type: 'datetime'
$type
protected
string
$type
= ''
Attributes
- #[Column]
- $name: 'type'
- $type: 'string'
- $length: 64
- $unique: true
$updateDatetime
protected
DateTime|null
$updateDatetime
= null
Attributes
- #[Column]
- $name: 'update_datetime'
- $type: 'datetime'
- $nullable: true
Methods
__construct()
public
__construct([int|null $id = null ][, string $type = '' ][, bool $enabled = false ][, string|null $config = null ][, DateTime $insertDatetime = new DateTime() ][, DateTime|null $updateDatetime = null ]) : mixed
Parameters
- $id : int|null = null
- $type : string = ''
- $enabled : bool = false
- $config : string|null = null
- $insertDatetime : DateTime = new DateTime()
- $updateDatetime : DateTime|null = null
callInitMethods()
Calls `init{TraitName}()` for every used trait that defines such a method.
public
callInitMethods() : void
getAllTraits()
Returns all traits the class uses, including those used by parent classes and nested traits.
public
getAllTraits() : array<string, string>
Return values
array<string, string>getConfig()
Invalid, empty or non-object JSON yields `[]`; non-scalar values are dropped.
public
getConfig() : array<string, scalar|null>
Return values
array<string, scalar|null>getId()
public
getId() : int|null
Return values
int|nullgetInsertDatetime()
public
getInsertDatetime() : DateTime
Return values
DateTimegetType()
public
getType() : string
Return values
stringgetUpdateDatetime()
public
getUpdateDatetime() : DateTime|null
Return values
DateTime|nullisEnabled()
public
isEnabled() : bool
Return values
boolisPersisted()
public
isPersisted() : bool
Return values
boolsetConfig()
public
setConfig(array<string, scalar|null> $config) : $this
Parameters
- $config : array<string, scalar|null>
Return values
$thissetEnabled()
public
setEnabled(bool $enabled) : $this
Parameters
- $enabled : bool
Return values
$thissetId()
public
setId(int|null $id) : $this
Parameters
- $id : int|null
Return values
$thissetInsertDatetime()
public
setInsertDatetime(DateTime $insertDatetime) : $this
Parameters
- $insertDatetime : DateTime
Return values
$thissetType()
public
setType(string $type) : $this
Parameters
- $type : string
Return values
$thissetUpdateDatetime()
public
setUpdateDatetime(DateTime|null $updateDatetime) : $this
Parameters
- $updateDatetime : DateTime|null
Return values
$thisgetTraitsRecursive()
Walks the trait list recursively and collects nested traits too.
private
static getTraitsRecursive(array<string, string> $traits) : array<string, string>
Parameters
- $traits : array<string, string>