Files
cachet-docker/app/Presenters/SubscriberPresenter.php
2015-12-23 22:09:24 +08:00

46 lines
1.0 KiB
PHP

<?php
/*
* This file is part of Cachet.
*
* (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;
use CachetHQ\Cachet\Presenters\Traits\TimestampsTrait;
use Jenssegers\Date\Date;
class SubscriberPresenter extends AbstractPresenter
{
use TimestampsTrait;
/**
* Present formatted date time.
*
* @return string
*/
public function verified_at()
{
return (new Date($this->wrappedObject->verified_at))
->setTimezone($this->setting->get('app_timezone'))->toDateTimeString();
}
/**
* Convert the presenter instance to an array.
*
* @return string[]
*/
public function toArray()
{
return array_merge($this->wrappedObject->toArray(), [
'created_at' => $this->created_at(),
'updated_at' => $this->updated_at(),
'verified_at' => $this->verified_at(),
]);
}
}