File: /home/lzgqnjwu/sites/bot.sgt.com.ua/common/helpers/PagecatHelper.php
<?php
namespace common\helpers;
use common\models\Languages;
use common\models\PageCat;
use yii\helpers\ArrayHelper;
use yii\helpers\Html;
use yii;
/**
* Class PostHelper
* @package common\helpers
*/
class PagecatHelper
{
public static function customer_groupsList(): array
{
return [
PageCat::ALL => Yii::t('common', 'All'),
PageCat::SUBSCRIPTION_USER => Yii::t('common', 'Subscription users'),
];
}
public static function customer_groupName($status): string
{
if($status && $status !== NULL){
return ArrayHelper::getValue(self::customer_groupsList(), $status);
}
else{
return '---';
}
}
public static function cat_typeList(): array
{
return [
PageCat::NONE_TYPE => Yii::t('common', 'None'),
PageCat::NEWS_TYPE => Yii::t('common', 'News'),
PageCat::ARTICLES_TYPE => Yii::t('common', 'Articles'),
PageCat::BLOG_TYPE => Yii::t('common', 'Blog'),
PageCat::OTHER_TYPE => Yii::t('common', 'Other')
];
}
public static function cat_typeName($status): string
{
if($status !== NULL && !empty($status)){
return ArrayHelper::getValue(self::cat_typeList(), $status);
}
else{
return '---';
}
}
}