ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
PositionTitle.php
Go to the documentation of this file.
1 <?php
2 
21 
23 
28 class PositionTitle extends Base
29 {
30  public const POSITION_ID = 'position_id';
31 
35  protected function run(array $params): string
36  {
37  $position_id = $params[self::POSITION_ID];
38 
39  $record = $this->positionRepo->getSingle($position_id, 'id');
40  if ($record instanceof ilOrgUnitPosition) {
41  return $record->getTitle();
42  } else {
43  $this->addError("Position with id {$position_id} not found");
44  }
45  }
46 
50  public function getName(): string
51  {
52  return "getPositionTitle";
53  }
54 
55  protected function getAdditionalInputParams(): array
56  {
57  return array(self::POSITION_ID => Base::TYPE_INT);
58  }
59 
60  public function getOutputParams(): array
61  {
62  return array('title' => Base::TYPE_STRING);
63  }
64 
65  public function getDocumentation(): string
66  {
67  return "Returns the title of a position for a given position id";
68  }
69 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
Definition: ltiregstart.php:31
getDocumentation()
Get the documentation of this method.
getOutputParams()
Get the output parameters in the same format as the input parameters.