/** * @param $userId * * @return \consim\core\entity\ConsimUser */ public function getUser($userId) { if (null !== $this->currentUser && $this->currentUser->getUserId()) { return $this->currentUser; } return $this->container->get('consim.core.entity.consim_user')->load($userId); }