LoggedAtProperty   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 6
Bugs 0 Features 0
Metric Value
wmc 2
c 6
b 0
f 0
lcom 1
cbo 1
dl 0
loc 29
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A get_logged_at() 0 4 1
A set_logged_at() 0 4 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;
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