Cachet/app/Presenters/Traits/TimestampsTrait.php

48 lines
1006 B
PHP
Raw Normal View History

<?php
/*
* This file is part of Cachet.
*
2015-07-06 17:37:01 +01:00
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace CachetHQ\Cachet\Presenters\Traits;
2016-02-02 20:35:31 +00:00
use CachetHQ\Cachet\Dates\DateFactory;
trait TimestampsTrait
{
/**
* Present formatted date time.
*
* @return string
*/
public function created_at()
{
2016-02-02 20:35:31 +00:00
return app(DateFactory::class)->make($this->wrappedObject->created_at)->toDateTimeString();
}
/**
* Present formatted date time.
*
* @return string
*/
public function updated_at()
{
2016-02-02 20:35:31 +00:00
return app(DateFactory::class)->make($this->wrappedObject->updated_at)->toDateTimeString();
}
/**
* Present formatted date time.
*
* @return string
*/
public function deleted_at()
{
2016-02-02 20:35:31 +00:00
return app(DateFactory::class)->make($this->wrappedObject->deleted_at)->toDateTimeString();
}
}