IsActivatedColumn::render_cell()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 9
rs 9.6666
cc 2
eloc 4
nc 2
nop 1
1
<?php
2
3
/*
4
 * This file is part of the Icybee package.
5
 *
6
 * (c) Olivier Laviale <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Icybee\Modules\Users\Block\ManageBlock;
13
14
use Icybee\Block\ManageBlock\BooleanColumn;
15
use Icybee\Modules\Users\Block\ManageBlock;
16
use Icybee\Modules\Users\User;
17
18
/**
19
 * Representation of the `is_activated` column.
20
 */
21
class IsActivatedColumn extends BooleanColumn
22
{
23
	public function __construct(ManageBlock $manager, $id, array $options = [])
24
	{
25
		parent::__construct($manager, $id, $options + [
26
27
				'title' => null,
28
				'class' => 'cell-fitted',
29
				'filters' => [
30
31
					'options' => [
32
33
						'=1' => 'Activated',
34
						'=0' => 'Deactivated'
35
36
					]
37
38
				]
39
40
			]);
41
	}
42
43
	/**
44
	 * @param User $record
45
	 *
46
	 * @inheritdoc
47
	 */
48
	public function render_cell($record)
49
	{
50
		if ($record->is_admin)
51
		{
52
			return null;
53
		}
54
55
		return parent::render_cell($record);
56
	}
57
}
58