Completed
Pull Request — devel (#146)
by Litera
24:35 queued 19:02
created

EventService::insertEnroll()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 9
nc 1
nop 3
dl 0
loc 12
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace App\Services\Skautis;
4
5
/**
6
 * User service
7
 */
8
class EventService extends SkautisService
9
{
10
11
	/**
12
	 * @param   void
13
	 * @return  stdClass
14
	 *
15
	 * @throws Skautis\Wsdl\WsdlException
16
	 */
17
	public function insertParticipant($loginId, $personId, $educationEventId, $educationEventCourseId)
18
	{
19
		return $this->getSkautis()
20
			->event
21
			->participantEducationInsert(([
22
				'ID_EventEducation'       => $educationEventId,
23
				'ID_Person'               => $personId,
24
				'ID_EventEducationCourse' => $educationEventCourseId,
25
				'ID_Login'                => $loginId,
26
			]));
27
	}
28
29
	/**
30
	 * @param  int    $loginId
31
	 * @param  int    $educationEventCourseId
32
	 * @param  string $phone
33
	 * @return stdClass
34
	 *
35
	 * @throws Skautis\Wsdl\WsdlException
36
	 */
37
	public function insertEnroll($loginId, $educationEventCourseId, $phone)
38
	{
39
		return $this->getSkautis()
40
			->event
41
			->participantEducationInsertEnroll(([
42
				'ID_EventEducationCourse' => $educationEventCourseId,
43
				'ID_Login'                => $loginId,
44
				'Phone'                   => $phone,
45
				'Acknownledgement'        => true,
46
				'Affirmation'             => true,
47
			]));
48
	}
49
50
}
51