AdminColumns.php
1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?php
namespace AC\Plugin\SetupFactory;
use AC\Asset\Location\Absolute;
use AC\Plugin\Install;
use AC\Plugin\InstallCollection;
use AC\Plugin\Setup;
use AC\Plugin\SetupFactory;
use AC\Plugin\Update;
use AC\Plugin\UpdateCollection;
use AC\Plugin\Version;
final class AdminColumns extends SetupFactory
{
private $location;
public function __construct(
string $version_key,
Version $version,
Absolute $location,
InstallCollection $installers = null,
UpdateCollection $updates = null
) {
parent::__construct($version_key, $version, $installers, $updates);
$this->location = $location;
}
public function create(string $type): Setup
{
switch ($type) {
case self::NETWORK:
$this->installers = new InstallCollection([
new Install\Capabilities(),
]);
break;
case self::SITE:
$this->installers = new InstallCollection([
new Install\Capabilities(),
new Install\Database(),
]);
$this->updates = new UpdateCollection([
new Update\V3005(),
new Update\V3007(),
new Update\V3201($this->location),
new Update\V4000(),
]);
break;
}
return parent::create($type);
}
}