1 <?php
2
3 /*
4 * This file is part of the ICanBoogie package.
5 *
6 * (c) Olivier Laviale <olivier.laviale@gmail.com>
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 /**
15 * Implements a `created_at` property.
16 *
17 * @see DateTimeProperty
18 */
19 trait CreatedAtProperty
20 {
21 /**
22 * The date and time at which the record was created.
23 *
24 * @var string
25 */
26 private $created_at;
27
28 /**
29 * Returns the date and time at which the record was created.
30 *
31 * @return \ICanBoogie\DateTime
32 */
33 protected function get_created_at()
34 {
35 return DateTimePropertySupport::datetime_get($this->created_at);
36 }
37
38 /**
39 * Sets the date and time at which the record was created.
40 *
41 * @param mixed $value
42 */
43 protected function set_created_at($datetime)
44 {
45 DateTimePropertySupport::datetime_set($this->created_at, $datetime);
46 }
47 }