From b414fe6c569fe8610af18f09aeab3de046351ae9 Mon Sep 17 00:00:00 2001 From: noumo Date: Thu, 28 May 2015 13:46:11 +0300 Subject: [PATCH] add get time and date --- modules/article/api/ArticleObject.php | 7 +++++++ modules/catalog/api/ItemObject.php | 7 ++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/modules/article/api/ArticleObject.php b/modules/article/api/ArticleObject.php index 4f840d3..1414aa6 100644 --- a/modules/article/api/ArticleObject.php +++ b/modules/article/api/ArticleObject.php @@ -1,6 +1,7 @@ model->tagsArray; } + public function getDate(){ + return Yii::$app->formatter->asDate($this->time); + } + public function getPhotos() { if(!$this->_photos){ diff --git a/modules/catalog/api/ItemObject.php b/modules/catalog/api/ItemObject.php index b947add..70056b6 100644 --- a/modules/catalog/api/ItemObject.php +++ b/modules/catalog/api/ItemObject.php @@ -1,7 +1,7 @@ model->price; } + public function getDate(){ + return Yii::$app->formatter->asDate($this->time); + } + public function getPhotos() { if(!$this->_photos){