Completed
Pull Request — master (#375)
by Dalibor
05:23
created

ColumnAggregationFunction   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 59
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 59
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getAggregationType() 0 4 1
A setAggregationType() 0 5 1
A getColumn() 0 4 1
1
<?php
2
3
namespace Ublaboo\DataGrid\Column;
4
5
class ColumnAggregationFunction
6
{
7
	/**
8
	 * @var string
9
	 */
10
	protected $column;
11
12
	/**
13
	 * @var string
14
	 */
15
	protected $aggregation_type;
16
17
	public static $aggregation_type_sum = 'sum';
18
19
	public static $aggregation_type_avg = 'avg';
20
21
	public static $aggregation_type_min = 'min';
22
23
	public static $aggregation_type_max = 'max';
24
25
	/**
26
	 * ColumnSummary constructor.
27
	 * @param $aggregation_type
28
	 * @param string $column
29
	 */
30
	public function __construct($aggregation_type, $column)
31
	{
32
		$this->aggregation_type = $aggregation_type;
33
		$this->column = $column;
34
	}
35
36
37
	/**
38
	 * @return string
39
	 */
40
	public function getAggregationType()
41
	{
42
		return $this->aggregation_type;
43
	}
44
45
46
	/**
47
	 * @param string $value use ColumnAggregationFunction::$aggregation_type_...
48
	 * @return ColumnSummary
49
	 */
50
	public function setAggregationType($value)
51
	{
52
		$this->aggregation_type = $value;
53
		return $this;
54
	}
55
56
	/**
57
	 * @return string
58
	 */
59
	public function getColumn()
60
	{
61
		return $this->column;
62
	}
63
}
64