BwgroupsRequest::deleteGroup()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 1
dl 0
loc 6
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * This class is generated using the package carono/codegen
5
 */
6
7
namespace carono\etxtru\request;
8
9
class BwgroupsRequest extends \carono\etxtru\RequestAbstract
10
{
11
	/**
12
	 * Функция возвращает список групп для БС/ЧС текущего пользователя.
13
	 *
14
	 * @return \carono\etxtru\response\ListGroupsResponse|\stdClass
15
	 */
16
	public function listGroups()
17
	{
18
		$params = [];
19
		return $this->getClient()->getContent('bwgroups.listGroups', $params, 'carono\etxtru\response\ListGroupsResponse');
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->getClient(...se\ListGroupsResponse') also could return the type carono\etxtru\Response which is incompatible with the documented return type carono\etxtru\response\ListGroupsResponse|stdClass.
Loading history...
20
	}
21
22
23
	/**
24
	 * Функция добавляет или изменяет группу для БС/ЧС текущего пользователя.
25
	 *
26
	 * @param string $name Название группы, до 40 символов
27
	 * @param int $id Идентификатор редактируемой группы, если не указан, будет создана новая
28
	 * @param int $id_parent Идентификатор родительской категории, по умолчанию 0 - корень
29
	 * @return \carono\etxtru\response\SaveGroupResponse|\stdClass
30
	 */
31
	public function saveGroup($name, $id, $id_parent)
32
	{
33
		$params = [
34
			'name' => $name,
35
			'id' => $id,
36
			'id_parent' => $id_parent
37
		];
38
		return $this->getClient()->getContent('bwgroups.saveGroup', $params, 'carono\etxtru\response\SaveGroupResponse');
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->getClient(...nse\SaveGroupResponse') also could return the type carono\etxtru\Response which is incompatible with the documented return type carono\etxtru\response\SaveGroupResponse|stdClass.
Loading history...
39
	}
40
41
42
	/**
43
	 * Функция удаляет группу для БС/ЧС и все ее подгруппы текущего пользователя.
44
	 *
45
	 * @param int $id Идентификатор удаляемой группы
46
	 * @return \carono\etxtru\response\DeleteGroupResponse|\stdClass
47
	 */
48
	public function deleteGroup($id)
49
	{
50
		$params = [
51
			'id' => $id
52
		];
53
		return $this->getClient()->getContent('bwgroups.deleteGroup', $params, 'carono\etxtru\response\DeleteGroupResponse');
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->getClient(...e\DeleteGroupResponse') also could return the type carono\etxtru\Response which is incompatible with the documented return type carono\etxtru\response\D...eGroupResponse|stdClass.
Loading history...
54
	}
55
56
57
	/**
58
	 * Функция перемещает пользователя, уже занесенного в БС/ЧС, в указанную группу текущего
59
	 * пользователя.
60
	 *
61
	 * @param int $id_user Идентификатор пользователя, уже внесенного в БС/ЧС, для переноса в другую группу
62
	 * @param int $id_group Идентификатор группы для переноса, если 0 или не указана, то считается как "без группы"
63
	 * @return \carono\etxtru\response\UpdateGroupResponse|\stdClass
64
	 */
65
	public function updateGroup($id_user, $id_group)
66
	{
67
		$params = [
68
			'id_user' => $id_user,
69
			'id_group' => $id_group
70
		];
71
		return $this->getClient()->getContent('bwgroups.updateGroup', $params, 'carono\etxtru\response\UpdateGroupResponse');
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->getClient(...e\UpdateGroupResponse') also could return the type carono\etxtru\Response which is incompatible with the documented return type carono\etxtru\response\U...eGroupResponse|stdClass.
Loading history...
72
	}
73
}
74