FoldersRequest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 51
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 13
dl 0
loc 51
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A listFolders() 0 6 1
A moveToFolder() 0 8 1
A addFolder() 0 7 1
1
<?php
2
3
/**
4
 * This class is generated using the package carono/codegen
5
 */
6
7
namespace carono\etxtru\request;
8
9
class FoldersRequest extends \carono\etxtru\RequestAbstract
10
{
11
	/**
12
	 * Возвращает отсортированный список папок текущего пользователя.
13
	 *
14
	 * @param string $sort date - сортировка по дате создания, name - по названию (по умолчанию)
15
	 * @return \carono\etxtru\response\ListFoldersResponse|\stdClass
16
	 */
17
	public function listFolders($sort)
18
	{
19
		$params = [
20
			'sort' => $sort
21
		];
22
		return $this->getClient()->getContent('folders.listFolders', $params, 'carono\etxtru\response\ListFoldersResponse');
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->getClient(...e\ListFoldersResponse') also could return the type carono\etxtru\Response which is incompatible with the documented return type carono\etxtru\response\L...oldersResponse|stdClass.
Loading history...
23
	}
24
25
26
	/**
27
	 * Cоздает папку для текущего пользователя.
28
	 *
29
	 * @param string $name Название создаваемой папки (длинна от 1 до 128 знаков)
30
	 * @param int $id_parent Идентификатор родительской папки или 0 (по умолчанию) для корневой папки
31
	 * @return \carono\etxtru\response\AddFolderResponse|\stdClass
32
	 */
33
	public function addFolder($name, $id_parent)
34
	{
35
		$params = [
36
			'name' => $name,
37
			'id_parent' => $id_parent
38
		];
39
		return $this->getClient()->getContent('folders.addFolder', $params, 'carono\etxtru\response\AddFolderResponse');
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->getClient(...nse\AddFolderResponse') also could return the type carono\etxtru\Response which is incompatible with the documented return type carono\etxtru\response\AddFolderResponse|stdClass.
Loading history...
40
	}
41
42
43
	/**
44
	 * Фукнция перемещает объекты в папку.
45
	 *
46
	 * @param string $id_folder Идентификатор папки
47
	 * @param string $type Тип перемещаемых объектов. Значения: task - заказ archive - архивный заказ article - статья article_archive -
48
	 * архивная статья correction - коррекция bhv_task - задания
49
	 * @param int (array) $ids Массив идентификаторов перемещаемых объектов
50
	 * @return \carono\etxtru\response\MoveToFolderResponse|\stdClass
51
	 */
52
	public function moveToFolder($id_folder, $type, $ids)
53
	{
54
		$params = [
55
			'id_folder' => $id_folder,
56
			'type' => $type,
57
			'ids' => $ids
58
		];
59
		return $this->getClient()->getContent('folders.moveToFolder', $params, 'carono\etxtru\response\MoveToFolderResponse');
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->getClient(...\MoveToFolderResponse') also could return the type carono\etxtru\Response which is incompatible with the documented return type carono\etxtru\response\M...FolderResponse|stdClass.
Loading history...
60
	}
61
}
62