LoggedAtColumn::render_cell()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 11
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 11
rs 9.4285
cc 2
eloc 5
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\DateTimeColumn;
15
use Icybee\Modules\Users\User;
16
17
/**
18
 * Representation of the `logged_at` column.
19
 */
20
class LoggedAtColumn extends DateTimeColumn
21
{
22
	/**
23
	 * @param User $record
24
	 *
25
	 * @inheritdoc
26
	 */
27
	public function render_cell($record)
28
	{
29
		$logged_at = $record->logged_at;
30
31
		if ($logged_at->is_empty)
32
		{
33
			return '<em class="small">' . $this->manager->t("Never connected") . '</em>';
34
		}
35
36
		return parent::render_cell($record);
37
	}
38
}
39