Completed
Pull Request — master (#375)
by Dalibor
03:13
created

ColumnAggregationFunction   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 57
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

4 Methods

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