Completed
Push — master ( 41aa8c...a24106 )
by Julien
03:40
created

Segments::getList()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 12
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 12
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 7
nc 2
nop 1
1
<?php
2
3
namespace EncreInformatique\DoctorSenderApi\Endpoints;
4
5
class Segments extends Endpoint
6
{
7
    /*
8
     * SoapClient $client
9
     */
10
    private $client;
11
12
    public function __construct($client)
13
    {
14
        $this->client = $client;
15
    }
16
17
    /**
18
     * We get the List of Users.
19
     *
20
     * @param $options
21
     */
22
    public function getList($options)
23
    {
24
        if (!isset($options['name'])) {
25
            return ['error' => true, 'msg' => 'no name of list was provided'];
26
        }
27
        $listName = str_replace("list_", "", $options['name']);
28
29
        return $this->client->webservice(
30
            'dsSegmentsGetByListName',
31
            array($listName)
32
        );
33
    }
34
}
35