Passed
Push — master ( e448bf...51995c )
by Paul
07:24 queued 04:56
created

ArchiveMetaManager::getDefaultGroup()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace GeminiLabs\Pollux\MetaBox;
4
5
use GeminiLabs\Pollux\MetaBox\SiteMetaManager;
6
use GeminiLabs\Pollux\PostType\Archive;
7
8
/**
9
 * ArchiveMeta::all();
10
 * ArchiveMeta::group();
11
 * ArchiveMeta::group('option','fallback');
12
 * ArchiveMeta::get('group');
13
 * ArchiveMeta::get('group','option','fallback');
14
 */
15
class ArchiveMetaManager extends SiteMetaManager
16
{
17
	public function __construct()
18
	{
19
		$this->options = get_option( Archive::id(), [] );
20
	}
21
22
	/**
23
	 * @param string|null $key
24
	 * @param mixed $fallback
25
	 * @param string $group
26
	 * @return mixed
27
	 */
28
	public function get( $key = '', $fallback = null, $group = '' )
29
	{
30
		return parent::get( $group, $key, $fallback );
31
	}
32
33
	/**
34
	 * @return string
35
	 */
36
	protected function getDefaultGroup()
37
	{
38
		return get_post_type();
39
	}
40
}
41