IntegrationRepository.php
1.08 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
<?php
namespace AC;
use AC\Integration\Filter;
use ACP\Integration\Filter\IsActive;
class IntegrationRepository
{
public function find_all(): Integrations
{
return new Integrations([
new Integration\ACF(),
new Integration\BuddyPress(),
new Integration\EventsCalendar(),
new Integration\GravityForms(),
new Integration\JetEngine(),
new Integration\Pods(),
new Integration\Types(),
new Integration\MetaBox(),
new Integration\MediaLibraryAssistant(),
new Integration\WooCommerce(),
new Integration\YoastSeo(),
]);
}
public function find_all_active(): Integrations
{
return (new IsActive())->filter($this->find_all());
}
public function find_all_by_active_plugins(): Integrations
{
return (new Filter\IsPluginActive())->filter($this->find_all());
}
public function find_all_by_inactive_plugins(): Integrations
{
return (new Filter\IsPluginNotActive())->filter($this->find_all());
}
}