ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
ILIAS\MediaObjects\ImageMap\ImageMapRetrieval Class Reference
+ Inheritance diagram for ILIAS\MediaObjects\ImageMap\ImageMapRetrieval:
+ Collaboration diagram for ILIAS\MediaObjects\ImageMap\ImageMapRetrieval:

Public Member Functions

 __construct (protected \ilObjMediaObject $media_object)
 
 getData (array $fields, ?Range $range=null, ?Order $order=null, array $filter=[], array $parameters=[])
 
 count (array $filter=[], array $parameters=[])
 
 isFieldNumeric (string $field)
 
 getData (array $fields, ?Range $range=null, ?Order $order=null, array $filter=[], array $parameters=[])
 
 count (array $filter, array $parameters)
 
 isFieldNumeric (string $field)
 

Protected Member Functions

 collectData ()
 

Protected Attributes

array $data = null
 

Detailed Description

Definition at line 23 of file ImageMapRetrieval.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\MediaObjects\ImageMap\ImageMapRetrieval::__construct ( protected \ilObjMediaObject  $media_object)

Definition at line 29 of file ImageMapRetrieval.php.

31 {
32 }

Member Function Documentation

◆ collectData()

ILIAS\MediaObjects\ImageMap\ImageMapRetrieval::collectData ( )
protected

Definition at line 60 of file ImageMapRetrieval.php.

60 : array
61 {
62 if ($this->data !== null) {
63 return $this->data;
64 }
65
66 $item = $this->media_object->getMediaItem("Standard");
67 $data = [];
68 $highlight_modes = \ilMapArea::getAllHighlightModes();
69 $highlight_classes = \ilMapArea::getAllHighlightClasses();
70
71 for ($id = 1, $max = \ilMapArea::_getMaxNr($item->getId()); $id <= $max; $id++) {
72 $area = new \ilMapArea($item->getId(), $id);
73 $data[] = [
74 "id" => $id,
75 "title" => $area->getTitle(),
76 "shape" => $area->getShape(),
77 "coords" => implode(", ", explode(",", $area->getCoords())),
78 "highlight_mode" => $highlight_modes[$area->getHighlightMode()] ?? $area->getHighlightMode(),
79 "highlight_class" => $highlight_classes[$area->getHighlightClass()] ?? $area->getHighlightClass(),
80 "link_type" => $area->getLinkType(),
81 "href" => $area->getHref(),
82 "target" => $area->getTarget(),
83 "type" => $area->getType(),
84 "target_frame" => $area->getTargetFrame()
85 ];
86 }
87
88 return $this->data = $data;
89 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
static getAllHighlightClasses()
static _getMaxNr(int $a_item_id)
get maximum nr of media item (static)
static getAllHighlightModes()

References $data, $id, ilMapArea\_getMaxNr(), ilMapArea\getAllHighlightClasses(), and ilMapArea\getAllHighlightModes().

+ Here is the call graph for this function:

◆ count()

ILIAS\MediaObjects\ImageMap\ImageMapRetrieval::count ( array  $filter = [],
array  $parameters = [] 
)

Implements ILIAS\Repository\RetrievalInterface.

Definition at line 50 of file ImageMapRetrieval.php.

50 : int
51 {
52 return count($this->collectData());
53 }
count(array $filter=[], array $parameters=[])

◆ getData()

ILIAS\MediaObjects\ImageMap\ImageMapRetrieval::getData ( array  $fields,
?Range  $range = null,
?Order  $order = null,
array  $filter = [],
array  $parameters = [] 
)

Implements ILIAS\Repository\RetrievalInterface.

Definition at line 34 of file ImageMapRetrieval.php.

40 : \Generator {
41 $data = $this->collectData();
42 $data = $this->applyOrder($data, $order);
43 $data = $this->applyRange($data, $range);
44
45 foreach ($data as $row) {
46 yield $row;
47 }
48 }

◆ isFieldNumeric()

ILIAS\MediaObjects\ImageMap\ImageMapRetrieval::isFieldNumeric ( string  $field)

Implements ILIAS\Repository\RetrievalInterface.

Definition at line 55 of file ImageMapRetrieval.php.

55 : bool
56 {
57 return $field === "id";
58 }

Field Documentation

◆ $data

array ILIAS\MediaObjects\ImageMap\ImageMapRetrieval::$data = null
protected

Definition at line 27 of file ImageMapRetrieval.php.


The documentation for this class was generated from the following file: