jeyroik/extas-base

View on GitHub
src/components/THasCreatedAt.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php
namespace extas\components;

use extas\interfaces\IHasCreatedAt;

/**
 * Trait THasCreatedAt
 *
 * @property $config
 *
 * @package extas\components
 * @author jeyroik@gmail.com
 */
trait THasCreatedAt
{
    use THasTime;

    /**
     * @param string $format
     *
     * @return string|int
     */
    public function getCreatedAt(string $format = '')
    {
        return $this->getTime(IHasCreatedAt::FIELD__CREATED_AT, $format);
    }

    /**
     * @param int|\DateTime $time
     *
     * @return $this
     */
    public function setCreatedAt($time)
    {
        return $this->setTime(IHasCreatedAt::FIELD__CREATED_AT, $time);
    }
}