~xibo-maintainers/xibo/tempel

« back to all changes in this revision

Viewing changes to lib/Upgrade/ScheduleConvertStep.php

  • Committer: Dan Garner
  • Date: 2016-03-09 13:21:23 UTC
  • mto: This revision was merged to the branch mainline in revision 486.
  • Revision ID: git-v1:0239ef66bdce8b493972c57100700616e6365ef6
Working install/update

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
namespace Xibo\Upgrade;
10
10
 
11
11
 
 
12
use Xibo\Service\ConfigServiceInterface;
 
13
use Xibo\Service\LogServiceInterface;
 
14
use Xibo\Storage\StorageServiceInterface;
 
15
 
 
16
/**
 
17
 * Class ScheduleConvertStep
 
18
 * @package Xibo\Upgrade
 
19
 */
12
20
class ScheduleConvertStep implements  Step
13
21
{
14
 
    public static function doStep()
 
22
    /** @var  StorageServiceInterface */
 
23
    private $store;
 
24
 
 
25
    /** @var  LogServiceInterface */
 
26
    private $log;
 
27
 
 
28
    /** @var  ConfigServiceInterface */
 
29
    private $config;
 
30
 
 
31
    /**
 
32
     * DataSetConvertStep constructor.
 
33
     * @param StorageServiceInterface $store
 
34
     * @param LogServiceInterface $log
 
35
     * @param ConfigServiceInterface $config
 
36
     */
 
37
    public function __construct($store, $log, $config)
 
38
    {
 
39
        $this->store = $store;
 
40
        $this->log = $log;
 
41
        $this->config = $config;
 
42
    }
 
43
 
 
44
    /**
 
45
     * @param \Slim\Helper\Set $container
 
46
     * @throws \Xibo\Exception\NotFoundException
 
47
     */
 
48
    public function doStep($container)
15
49
    {
16
50
        // Get all events and their Associated display group id's
17
 
        foreach ($this->getStore()->select('SELECT eventId, displayGroupIds FROM `schedule`', []) as $event) {
 
51
        foreach ($this->store->select('SELECT eventId, displayGroupIds FROM `schedule`', []) as $event) {
18
52
            // Ping open the displayGroupIds
19
53
            $displayGroupIds = explode(',', $event['displayGroupIds']);
20
54
 
27
61
 
28
62
            $sql = rtrim($sql, ',');
29
63
 
30
 
            $this->getStore()->update($sql, []);
 
64
            $this->store->update($sql, []);
31
65
        }
32
66
    }
33
67
}
 
 
b'\\ No newline at end of file'