FEATURE #1359: add status changing (user management)
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: michal
|
||||
* Date: 24.1.16
|
||||
* Time: 23:20
|
||||
*/
|
||||
|
||||
namespace App\Enumerations;
|
||||
|
||||
use App\Models\User;
|
||||
|
||||
class UserStates
|
||||
{
|
||||
/**
|
||||
* Getter for states
|
||||
*
|
||||
* This method returns only list of roles as inserted into database
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getSimple()
|
||||
{
|
||||
return array_values(self::getWithTranslations());
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for states with translations
|
||||
*
|
||||
* This method returns all user states as keys. Values are strings used for translations.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getWithTranslations()
|
||||
{
|
||||
return [
|
||||
User::STATE_DELETED => 'admin/userManagement.status_' . User::STATE_DELETED,
|
||||
User::STATE_BLOCKED => 'admin/userManagement.status_' . User::STATE_BLOCKED,
|
||||
User::STATE_ACTIVE => 'admin/userManagement.status_' . User::STATE_ACTIVE
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user