2015-05-20 12:57:22 -05:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/*
|
|
|
|
* This file is part of Cachet.
|
|
|
|
*
|
2015-07-06 17:37:01 +01:00
|
|
|
* (c) Alt Three Services Limited
|
2015-05-20 12:57:22 -05:00
|
|
|
*
|
|
|
|
* 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;
|
2015-05-20 12:57:22 -05:00
|
|
|
|
|
|
|
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();
|
2015-05-20 12:57:22 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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();
|
2015-05-20 12:57:22 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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();
|
2015-05-20 12:57:22 -05:00
|
|
|
}
|
|
|
|
}
|