Completed
Push — master ( 5e8ba0...5ef40e )
by dotzero
10s
created

Element   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 1
dl 0
loc 23
ccs 0
cts 5
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A apiList() 0 6 2
1
<?php
2
3
namespace AmoCRM\Models;
4
5
/**
6
 * Class Element
7
 *
8
 * Класс модель для работы с Элементами каталога
9
 *
10
 * @package AmoCRM\Models
11
 * @author [email protected]
12
 * @link https://github.com/dotzero/amocrm-php
13
 *
14
 * For the full copyright and license information, please view the LICENSE
15
 * file that was distributed with this source code.
16
 */
17
class Element extends AbstractModel
18
{
19
    /**
20
     * @var array Список доступный полей для модели (исключая кастомные поля)
21
     */
22
    protected $fields = [];
23
24
    /**
25
     * Список элементов каталога
26
     *
27
     * Метод для получения элементов каталога аккаунта.
28
     *
29
     * @link https://developers.amocrm.ru/rest_api/catalog_elements/list.php
30
     * @param array $parameters Массив параметров к amoCRM API
31
     * @return array Ответ amoCRM API
32
     */
33
    public function apiList($parameters)
34
    {
35
        $response = $this->getRequest('/private/api/v2/json/catalog_elements/list', $parameters);
36
37
        return isset($response['catalog_elements']) ? $response['catalog_elements'] : [];
38
    }
39
}
40