2019-01-16 10:28:06 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Utils\Traits;
|
|
|
|
|
2019-01-27 00:22:57 +01:00
|
|
|
/**
|
|
|
|
* Class UserSettings
|
|
|
|
* @package App\Utils\Traits
|
|
|
|
*/
|
2019-01-16 10:28:06 +01:00
|
|
|
trait UserSettings
|
|
|
|
{
|
|
|
|
|
2019-01-27 00:22:57 +01:00
|
|
|
/**
|
|
|
|
* @param string $entity
|
|
|
|
* @return \stdClass
|
|
|
|
*/
|
2019-01-16 10:28:06 +01:00
|
|
|
public function getEntity(string $entity) : \stdClass
|
|
|
|
{
|
|
|
|
return $this->settings()->{$entity};
|
|
|
|
}
|
|
|
|
|
2019-01-27 00:22:57 +01:00
|
|
|
/**
|
|
|
|
* @param string $entity
|
|
|
|
* @return \stdClass
|
|
|
|
*/
|
2019-01-16 10:28:06 +01:00
|
|
|
public function getColumnVisibility(string $entity) : \stdClass
|
|
|
|
{
|
|
|
|
return $this->settings()->{class_basename($entity)}->datatable->column_visibility;
|
|
|
|
}
|
|
|
|
}
|