Bristol SU Support Package
Public Member Functions | List of all members
BristolSU\Support\Connection\ConnectionRepository Class Reference
Inheritance diagram for BristolSU\Support\Connection\ConnectionRepository:
Inheritance graph
[legend]
Collaboration diagram for BristolSU\Support\Connection\ConnectionRepository:
Collaboration graph
[legend]

Public Member Functions

 all ()
 
 get (int $id)
 
 delete (int $id)
 
 create (array $attributes)
 
 update (int $id, array $attributes)
 
 getAllForService (string $service)
 
 getAllForConnector (string $alias)
 

Detailed Description

Handles connections

Definition at line 11 of file ConnectionRepository.php.

Member Function Documentation

◆ all()

BristolSU\Support\Connection\ConnectionRepository::all ( )

Get all connections

Returns
Connection[]|

Implements BristolSU\Support\Connection\Contracts\ConnectionRepository.

Definition at line 19 of file ConnectionRepository.php.

◆ create()

BristolSU\Support\Connection\ConnectionRepository::create ( array  $attributes)

Create a connection

Attributes should contain [ 'name' => 'Connection Name', 'description' => 'Connection Description', 'alias' => 'connector_alias', 'settings' => [ 'api_key' => 'abc123', ... ] ] The settings are the settings specific to the connector being used.

Parameters
array$attributesAttributes to make the connection
Returns
Connection New connection

Implements BristolSU\Support\Connection\Contracts\ConnectionRepository.

Definition at line 64 of file ConnectionRepository.php.

◆ delete()

BristolSU\Support\Connection\ConnectionRepository::delete ( int  $id)

Delete a connection

Parameters
int$idID of the connection
Returns
bool|void|null
Exceptions

Implements BristolSU\Support\Connection\Contracts\ConnectionRepository.

Definition at line 42 of file ConnectionRepository.php.

◆ get()

BristolSU\Support\Connection\ConnectionRepository::get ( int  $id)

Get a connection by ID

Parameters
int$idID of the connection
Returns
Connection

Implements BristolSU\Support\Connection\Contracts\ConnectionRepository.

Definition at line 30 of file ConnectionRepository.php.

◆ getAllForConnector()

BristolSU\Support\Connection\ConnectionRepository::getAllForConnector ( string  $alias)

Get all connections for a specific connector

Parameters
string$aliasConnector to return connections for
Returns
Connection[]

Implements BristolSU\Support\Connection\Contracts\ConnectionRepository.

Definition at line 115 of file ConnectionRepository.php.

Referenced by BristolSU\Support\Connection\ConnectionRepository\getAllForService().

◆ getAllForService()

BristolSU\Support\Connection\ConnectionRepository::getAllForService ( string  $service)

Get all connections for a service. These may be from multiple connectors.

Parameters
string$serviceService to get the connections for
Returns
Connection[]|Collection

Implements BristolSU\Support\Connection\Contracts\ConnectionRepository.

Definition at line 102 of file ConnectionRepository.php.

References BristolSU\Support\Connection\RegisteredConnector\getAlias(), and BristolSU\Support\Connection\ConnectionRepository\getAllForConnector().

◆ update()

BristolSU\Support\Connection\ConnectionRepository::update ( int  $id,
array  $attributes 
)

Update a connection

Attributes can contain [ 'name' => 'Connection Name', 'description' => 'Connection Description', 'alias' => 'connector_alias', 'settings' => [ 'api_key' => 'abc123', ... ] ]

Parameters
int$idID of the connection to update
array$attributesAttributes to change
Returns
Connection Edited connection
Exceptions

Implements BristolSU\Support\Connection\Contracts\ConnectionRepository.

Definition at line 88 of file ConnectionRepository.php.


The documentation for this class was generated from the following file: