ILIAS  trunk Revision v11.0_alpha-1713-gd8962da2f67
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
PositionTitle.php
Go to the documentation of this file.
1 <?php
2 
20 
22 
27 class PositionTitle extends Base
28 {
29  public const POSITION_ID = 'position_id';
30 
34  protected function run(array $params): string
35  {
36  $position_id = $params[self::POSITION_ID];
37 
38  $record = $this->positionRepo->getSingle($position_id, 'id');
39  if ($record instanceof ilOrgUnitPosition) {
40  return $record->getTitle();
41  } else {
42  $this->addError("Position with id {$position_id} not found");
43  }
44  }
45 
49  public function getName(): string
50  {
51  return "getPositionTitle";
52  }
53 
54  protected function getAdditionalInputParams(): array
55  {
56  return array(self::POSITION_ID => Base::TYPE_INT);
57  }
58 
59  public function getOutputParams(): array
60  {
61  return array('title' => Base::TYPE_STRING);
62  }
63 
64  public function getDocumentation(): string
65  {
66  return "Returns the title of a position for a given position id";
67  }
68 }
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.