proglab / selligent-client-bundle
Selligent Client Bundle
Installs: 1 251
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 4
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: >=8.1
- ext-soap: *
- symfony/framework-bundle: ^6.1
- symfony/http-kernel: ^6.1
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.0.0
- phpstan/phpstan: ^0.12.88
- phpunit/phpunit: ^9.5
- roave/security-advisories: dev-master
- symfony/phpunit-bridge: ^5.3
- symfony/test-pack: ^1.0
README
A Selligent basic client
Installation
You must add this to your .env file :
###> proglab/selligent-client-bundle ###
APISELLIGENTCLIENT_INDIVIDUAL_URL=xxx
APISELLIGENTCLIENT_BROADCAST_URL=xxx
APISELLIGENTCLIENT_LOGIN=xxx
APISELLIGENTCLIENT_PASSWORD=xxx
###< proglab/selligent-client-bundle ###
Open a command console, enter your project directory and execute:
composer require proglab/selligent-client-bundle
If you're not using symfony/flex, enable the bundle by adding it to the list of registered bundles
in the config/bundles.php
file of your project:
// config/bundles.php return [ // ... Proglab\SelligentClientBundle\SelligentClientBundle::class => ['all' => true], ];
Usage
Generals
Getting a SelligentClient
You have two choices:
- Create the client manually, and pass it a logger:
use Proglab\SelligentClientBundle\Service\SelligentClient; use Psr\Log\NullLogger; $logger = new NullLogger(); $client = new SelligentClient($logger);
- Get the client from Dependency Injection:
use Proglab\SelligentClientBundle\Service\SelligentClient; class Service { public function __construct(private SelligentClient $client) { } }
Connection
You must connect to Selligent SOAP API.
You need the individual_url, broadcast_url, login and password.
$client->connect('individual_url', 'broadcast_url', 'login', 'password');
Get a record
Get a record with a filter :
$filters = ['ID' => 18]; $listId = 54; $client->getOneByFilter($filters, $listId);
Create a row
Create a record in a list :
$data = [ 'MAIL' => 'xx@xxxxx.xxx', 'NAME' => 'xxxxx xxxx', 'LANGUAGE' => 'fr' ]; $listId = 54; $client->createRow($data, $listId);
Update a row
Update a record in a list :
$data = ['FIRSTNAME' => 'Fabrice']; $listId = 54; $client->updateRow($data, 54, $listId);