Online::execute()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
/**
3
 * Copyright (c) 2014, Tobia De Koninck hey--at--ledfan.be
4
 * This file is licensed under the AGPL version 3 or later.
5
 * See the COPYING file.
6
 */
7
8
namespace OCA\Chat\OCH\Commands;
9
10
use \OCA\CHat\App\Chat;
11
use \OCA\Chat\OCH\ChatAPI;
12
use \OCA\Chat\OCH\Db\UserOnlineMapper;
13
use \OCA\Chat\OCH\Commands\SyncOnline;
14
15
class Online extends ChatAPI {
16
17
	/**
18
	 * @var $userMapper \OCA\Chat\OCH\Db\UserOnlineMapper
19
	 */
20
	private $userOnlineMapper;
21
22
	/**
23
	 * @var $syncOnline \OCA\Chat\OCH\Commands\SyncOnline
24
	 */
25
	private $syncOnline;
26
27
	public function __construct(
28
		UserOnlineMapper $userOnlineMapper,
29
		SynConline $syncOnline
30
	){
31
		$this->userOnlineMapper = $userOnlineMapper;
32
		$this->syncOnline = $syncOnline;
33
34
	}
35
36
	public function setRequestData(array $requestData){
37
		$this->requestData = $requestData;
38
	}
39
40
	public function execute(){
41
		$this->userOnlineMapper->updateLastOnline($this->requestData['session_id'], $this->requestData['timestamp']);
42
		$this->syncOnline->execute();
43
	}
44
}
45