Completed
Pull Request — master (#45)
by Matt
53:10 queued 18:15
created

m10_views_clicks_data::update_data()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
c 1
b 1
f 0
dl 0
loc 7
rs 9.4285
cc 1
eloc 4
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 m10_views_clicks_data extends \phpbb\db\migration\migration
14
{
15
	/**
16
	* {@inheritDoc}
17
	*/
18
	public function effectively_installed()
19
	{
20
		return $this->config->offsetExists('phpbb_ads_enable_views');
21
	}
22
23
	/**
24
	* {@inheritDoc}
25
	*/
26
	static public function depends_on()
27
	{
28
		return array(
29
			'\phpbb\ads\migrations\v10x\m1_initial_schema',
30
			'\phpbb\ads\migrations\v10x\m9_views_clicks_schema',);
31
	}
32
33
	/**
34
	 * Add phpbb_ads_enable_views and phpbb_ads_enable_clicks config
35
	 *
36
	 * @return array Array of data update instructions
37
	 */
38
	public function update_data()
39
	{
40
		return array(
41
			array('config.add', array('phpbb_ads_enable_views', 0)),
42
			array('config.add', array('phpbb_ads_enable_clicks', 0)),
43
		);
44
	}
45
}
46