~xibo-maintainers/xibo/tempel

« back to all changes in this revision

Viewing changes to lib/XMR/ChangeLayoutAction.php

  • Committer: Dan Garner
  • Date: 2015-03-26 14:08:33 UTC
  • Revision ID: git-v1:70d14044444f8dc5d602b99890d59dea46d9470c
Moved web servable files to web folder

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<?php
2
 
/*
3
 
 * Spring Signage Ltd - http://www.springsignage.com
4
 
 * Copyright (C) 2015 Spring Signage Ltd
5
 
 * (ChangeLayoutAction.php)
6
 
 */
7
 
 
8
 
 
9
 
namespace Xibo\XMR;
10
 
 
11
 
 
12
 
class ChangeLayoutAction extends PlayerAction
13
 
{
14
 
    public $layoutId;
15
 
    public $duration;
16
 
    public $downloadRequired;
17
 
    public $changeMode;
18
 
 
19
 
    /**
20
 
     * Set details for this layout
21
 
     * @param int $layoutId the layoutId to change to
22
 
     * @param int $duration the duration this layout should be shown
23
 
     * @param bool|false $downloadRequired flag indicating whether a download is required before changing to the layout
24
 
     * @param string $changeMode whether to queue or replace
25
 
     * @return $this
26
 
     */
27
 
    public function setLayoutDetails($layoutId, $duration = 0, $downloadRequired = false, $changeMode = 'queue')
28
 
    {
29
 
        if ($duration === null)
30
 
            $duration = 0;
31
 
 
32
 
        $this->layoutId = $layoutId;
33
 
        $this->duration = $duration;
34
 
        $this->downloadRequired = $downloadRequired;
35
 
        $this->changeMode = $changeMode;
36
 
 
37
 
        return $this;
38
 
    }
39
 
 
40
 
    public function getMessage()
41
 
    {
42
 
        $this->action = 'changeLayout';
43
 
 
44
 
        if ($this->layoutId == 0)
45
 
            throw new PlayerActionException('Layout Details not provided');
46
 
 
47
 
        return $this->serializeToJson(['layoutId', 'duration', 'downloadRequired', 'changeMode']);
48
 
    }
49
 
}
 
 
b'\\ No newline at end of file'