LoggedAtProperty::get_logged_at()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
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;
13
14
use ICanBoogie\ActiveRecord\DateTimePropertySupport;
15
use ICanBoogie\DateTime;
16
17
/**
18
 * Implements the`logged_at` property.
19
 *
20
 * @property DateTime $logged_at The date and time at which the user was logged.
21
 */
22
trait LoggedAtProperty
23
{
24
	/**
25
	 * The date and time at which the user was logged.
26
	 *
27
	 * @var DateTime
28
	 */
29
	private $logged_at;
30
31
	/**
32
	 * Returns the date and time at which the user was logged.
33
	 *
34
	 * @return DateTime
35
	 */
36
	protected function get_logged_at()
37
	{
38
		return DateTimePropertySupport::get($this->logged_at);
39
	}
40
41
	/**
42
	 * Sets the date and time at which the user was logged.
43
	 *
44
	 * @param \DateTime|string|null $datetime
45
	 */
46
	protected function set_logged_at($datetime)
47
	{
48
		DateTimePropertySupport::set($this->logged_at, $datetime);
49
	}
50
}
51