3
* Spring Signage Ltd - http://www.springsignage.com
4
* Copyright (C) 2015 Spring Signage Ltd
10
use Xibo\Exception\DeadlockException;
11
use Xibo\Service\LogServiceInterface;
12
use Xibo\Storage\StorageServiceInterface;
17
* @package Xibo\Entity
24
public static $REGISTER = 1;
25
public static $RF = 2;
26
public static $SCHEDULE = 3;
27
public static $GETFILE = 4;
28
public static $GETRESOURCE = 5;
29
public static $MEDIAINVENTORY = 6;
30
public static $NOTIFYSTATUS = 7;
31
public static $SUBMITSTATS = 8;
32
public static $SUBMITLOG = 9;
33
public static $BLACKLIST = 10;
34
public static $SCREENSHOT = 11;
42
* @param StorageServiceInterface $store
43
* @param LogServiceInterface $log
45
public function __construct($store, $log)
47
$this->setCommonDependencies($store, $log);
50
public function save()
53
$this->getStore()->updateWithDeadlockLoop('
54
INSERT INTO `bandwidth` (Month, Type, DisplayID, Size)
55
VALUES (:month, :type, :displayId, :size)
56
ON DUPLICATE KEY UPDATE Size = Size + :size2
58
'month' => strtotime(date('m') . '/02/' . date('Y') . ' 00:00:00'),
59
'type' => $this->type,
60
'displayId' => $this->displayId,
61
'size' => $this->size,
62
'size2' => $this->size
64
} catch (DeadlockException $deadlockException) {
65
$this->getLog()->error('Deadlocked inserting bandwidth');
b'\\ No newline at end of file'