ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
PositionTitle.php
Go to the documentation of this file.
1<?php
2
4
6
12class PositionTitle extends Base
13{
14
20 const POSITION_ID = 'position_id';
21
22
23 protected function run(array $params)
24 {
25 $position_id = $params[self::POSITION_ID];
26
27 $record = ilOrgUnitPosition::find($position_id);
28 if ($record instanceof ilOrgUnitPosition) {
29 return $record->getTitle();
30 } else {
31 $this->error("Position with id {$position_id} not found");
32 }
33 }
34
35
39 public function getName()
40 {
41 return "getPositionTitle";
42 }
43
44
48 protected function getAdditionalInputParams()
49 {
50 return array(self::POSITION_ID => Base::TYPE_INT);
51 }
52
53
57 public function getOutputParams()
58 {
59 return array('title' => Base::TYPE_STRING);
60 }
61
62
66 public function getDocumentation()
67 {
68 return "Returns the title of a position for a given position id";
69 }
70}
An exception for terminatinating execution or to throw for unit testing.
getDocumentation()
Get the documentation of this method.string
getOutputParams()
Get the output parameters in the same format as the input parameters.array
Class ilOrgUnitPosition.