| | |
| | | <?php |
| | | |
| | | use JVBase\Instance; |
| | | use JVBase\managers\Cache; |
| | | use JVBase\meta\Meta; |
| | | use JVBase\registrar\Registrar; |
| | | use JVBase\rest\PermissionHandler; |
| | |
| | | */ |
| | | class UserRoutes extends Rest |
| | | { |
| | | use Instance; |
| | | public function __construct() |
| | | { |
| | | $this->cacheName = 'user'; |
| | | $this->cacheTtl = WEEK_IN_SECONDS; |
| | | |
| | | parent::__construct(); |
| | | $this->cache = Cache::for($this->cacheName, 'user', $this->cacheTtl); |
| | | |
| | | } |
| | | |
| | |
| | | try { |
| | | $meta = Meta::forUser($user_id); |
| | | $meta->setAll($data['changes']); |
| | | Cache::clearUser($user_id); |
| | | return $this->success(); |
| | | } catch (Exception $e) { |
| | | return $this->error($e->getMessage()); |