ActionCallback   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 1
c 0
b 0
f 0
lcom 1
cbo 1
dl 0
loc 26
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A createLink() 0 9 1
1
<?php
2
3
/**
4
 * @copyright   Copyright (c) 2015 ublaboo <[email protected]>
5
 * @author      Pavel Janda <[email protected]>
6
 * @package     Ublaboo
7
 */
8
9
namespace Ublaboo\DataGrid\Column;
10
11
use Ublaboo\DataGrid\DataGrid;
12
13
/**
14
 * @method void onClick(mixed $id)
15
 */
16
class ActionCallback extends Action
17
{
18
19
	/**
20
	 * @var callable
21
	 */
22
	public $onClick = [];
23
24
25
	/**
26
	 * Create link to datagrid::handleActionCallback() to fire custom callback
27
	 * @param  DataGrid $grid
28
	 * @param  string   $href
29
	 * @param  array    $params
30
	 * @return string
31
	 */
32
	protected function createLink(DataGrid $grid, $href, $params)
33
	{
34
		/**
35
		 * Int case of ActionCallback, $this->href is a identifier of user callback
36
		 */
37
		$params = $params + ['__key' => $this->href];
38
39
		return $this->grid->link('actionCallback!', $params);
40
	}
41
}
42