CreatedAtProperty   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A get_created_at() 0 4 1
A set_created_at() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of the ICanBoogie 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 ICanBoogie\ActiveRecord;
13
14
use ICanBoogie\DateTime;
15
16
/**
17
 * Implements a `created_at` property.
18
 *
19
 * @see DateTimeProperty
20
 *
21
 * @property DateTime $created_at
22
 */
23
trait CreatedAtProperty
24
{
25
	/**
26
	 * The date and time at which the record was created.
27
	 *
28
	 * @var mixed
29
	 */
30
	private $created_at;
31
32
	/**
33
	 * Returns the date and time at which the record was created.
34
	 *
35
	 * @return DateTime
36
	 */
37
	protected function get_created_at()
38
	{
39
		return DateTimePropertySupport::get($this->created_at);
40
	}
41
42
	/**
43
	 * Sets the date and time at which the record was created.
44
	 *
45
	 * @param mixed $datetime
46
	 */
47
	protected function set_created_at($datetime)
48
	{
49
		DateTimePropertySupport::set($this->created_at, $datetime);
50
	}
51
}
52