JetEngine.php
971 Bytes
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
<?php
namespace ACA\JetEngine;
use AC;
use AC\Registerable;
use ACP\Service\IntegrationStatus;
class JetEngine implements Registerable {
private $location;
public function __construct( AC\Asset\Location\Absolute $location ) {
$this->location = $location;
}
public function register() {
if ( ! class_exists( 'Jet_Engine', false ) || ! $this->check_minimum_jet_engine_version() ) {
return;
}
$services = [
new Service\Admin( $this->location ),
new Service\ColumnInstantiate,
new Service\ColumnGroups,
new Service\RelationalColumns(),
new Service\MetaColumns(),
new IntegrationStatus( 'ac-addon-jetengine' ),
];
foreach ( $services as $service ) {
if ( $service instanceof Registerable ) {
$service->register();
}
}
}
private function check_minimum_jet_engine_version(): bool {
$jet_engine = jet_engine();
return $jet_engine
? version_compare( $jet_engine->get_version(), '2.11.0', '>=' )
: false;
}
}