Completed
Pull Request — master (#24)
by Jakub
12:01 queued 04:37
created

m6_hide_for_group::depends_on()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
/**
3
 *
4
 * Advertisement management. An extension for the phpBB Forum Software package.
5
 *
6
 * @copyright (c) 2017 phpBB Limited <https://www.phpbb.com>
7
 * @license GNU General Public License, version 2 (GPL-2.0)
8
 *
9
 */
10
11
namespace phpbb\ads\migrations\v10x;
12
13
class m6_hide_for_group extends \phpbb\db\migration\container_aware_migration
14
{
15
	/**
16
	* {@inheritDoc}
17
	*/
18
	public function effectively_installed()
19
	{
20
		$config_text = $this->container->get('config_text');
21
22
		return $config_text->get('phpbb_ads_hide_groups') !== null;
23
	}
24
25
	/**
26
	* {@inheritDoc}
27
	*/
28
	static public function depends_on()
29
	{
30
		return array('\phpbb\ads\migrations\v10x\m2_acp_module');
31
	}
32
33
	/**
34
	* Add the ACP settings module
35
	*
36
	* @return array Array of data update instructions
37
	*/
38
	public function update_data()
39
	{
40
		return array(
41
			array('config_text.add', array('phpbb_ads_hide_groups', '[]')),
42
43
			array('module.add', array(
44
				'acp',
45
				'ACP_ADMANAGEMENT_TITLE',
46
				array(
47
					'module_basename'	=> '\phpbb\ads\acp\main_module',
48
					'modes'				=> array('settings'),
49
				),
50
			)),
51
		);
52
	}
53
}
54