Extra   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 25
c 0
b 0
f 0
ccs 2
cts 2
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getByAlias() 0 4 2
1
<?php
2
namespace Redaxscript\Model;
3
4
/**
5
 * parent class to provide the extra model
6
 *
7
 * @since 3.3.0
8
 *
9
 * @package Redaxscript
10
 * @category Model
11
 * @author Henry Ruhs
12
 */
13
14
class Extra extends ContentAbstract
15
{
16
	/**
17
	 * name of the table
18
	 *
19
	 * @var string
20
	 */
21
22
	protected $_table = 'extras';
23
24
	/**
25
	 * get the extra by alias
26
	 *
27
	 * @since 4.0.0
28
	 *
29
	 * @param string $extraAlias alias of the extra
30
	 *
31
	 * @return object|null
32
	 */
33
34 2
	public function getByAlias(string $extraAlias = null) : ?object
35
	{
36 2
		return $this->query()->where('alias', $extraAlias)->findOne() ? : null;
37
	}
38
}
39