aboutsummaryrefslogtreecommitdiff
path: root/app/class/Dbitem.php
blob: 44dec2cd140ae1ae544a17e7db6b70a615deb0b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php

namespace Wcms;

use DateTime;
use DateTimeImmutable;

abstract class Dbitem extends Item
{

    public function dry()
    {
        $array = [];
        foreach ($this as $var => $value) {
            if ($value instanceof DateTime || $value instanceof DateTimeImmutable) {
                $array[$var] = $this->$var('string');
            } else {
                $array[$var] = $this->$var();
            }
        }
        return $array;
    }
}