ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
ProfileAdapter.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
24 {
25  protected \ilLanguage $lng;
26 
27  public function __construct(
28  \ilLanguage $lng
29  ) {
30  $this->lng = $lng;
31  $this->lng->loadLanguageModule("rep");
32  }
33 
34  public function exists(int $user_id): bool
35  {
36  return \ilObjUser::userExists([$user_id]);
37  }
38 
39  public function getDeletedUserAvatarText(): string
40  {
41  return $this->lng->txt("deleted");
42  }
43 
44  public function getDeletedUserNamePresentation(): string
45  {
46  return $this->lng->txt("rep_deleted_account");
47  }
48 
49  public function getNamePresentation(int $user_id, bool $force = false): string
50  {
51  if (!$this->exists($user_id)) {
52  return $this->getDeletedUserNamePresentation();
53  }
54  return \ilUserUtil::getNamePresentation($user_id, false, false, "", $force);
55  }
56 }
getNamePresentation(int $user_id, bool $force=false)