6 * @link http://www.open-emr.org
7 * @author Matthew Vita <matthewvita48@gmail.com>
8 * @author Victor Kofia <victor.kofia@gmail.com>
9 * @copyright Copyright (c) 2017 Matthew Vita <matthewvita48@gmail.com>
10 * @copyright Copyright (c) 2017 Victor Kofia <victor.kofia@gmail.com>
11 * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
15 namespace OpenEMR\Services
;
17 use OpenEMR\Common\Database\Connector
;
22 * The user repository to be used for db CRUD operations.
27 * Default constructor.
29 public function __construct()
31 $database = Connector
::Instance();
32 $entityManager = $database->entityManager
;
33 $this->repository
= $entityManager->getRepository('\OpenEMR\Entities\User');
37 * @return Fully hydrated user object
39 public function getUser($userId)
41 return $this->repository
->getUser($userId);
45 * @return active users (fully hydrated)
47 public function getActiveUsers()
49 return $this->repository
->getActiveUsers();
53 * @return Fully hydrated user object.
55 public function getCurrentlyLoggedInUser()
57 return $this->repository
->getCurrentlyLoggedInUser();
61 * Centralized holder of the `authProvider` session
62 * value to encourage service ownership of global
65 * @return String of the current user group.
67 public function getCurrentlyLoggedInUserGroup()
69 return $_SESSION['authProvider'];