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

Public Member Functions

 __construct (protected \ilPCInteractiveImage|\ilPCMediaObject $content_obj, protected string $parent_node_name)
 
 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\COPage\PC\MediaObject\ImageMapRetrieval::__construct ( protected \ilPCInteractiveImage|\ilPCMediaObject  $content_obj,
protected string  $parent_node_name 
)

Definition at line 29 of file ImageMapRetrieval.php.

32 {
33 }

Member Function Documentation

◆ collectData()

ILIAS\COPage\PC\MediaObject\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 $alias_item = new \ilMediaAliasItem(
67 $this->content_obj->getDomDoc(),
68 $this->content_obj->hier_id,
69 "Standard",
70 $this->content_obj->getPCId(),
71 $this->parent_node_name
72 );
73 $data = [];
74 foreach ($alias_item->getMapAreas() as $area) {
75 $link = $area["Link"] ?? [];
76 $link_type = strtolower($link["LinkType"] ?? "");
77 $link_type = match ($link_type) {
78 "extlink" => "ext",
79 "intlink" => "int",
80 default => $link_type
81 };
82 $data[] = [
83 "id" => (int) $area["Nr"],
84 "title" => $link["Title"] ?? "",
85 "shape" => $area["Shape"],
86 "coords" => implode(", ", explode(",", $area["Coords"])),
87 "highlight_mode" => $area["HighlightMode"],
88 "highlight_class" => $area["HighlightClass"],
89 "link_type" => $link_type,
90 "href" => $link["Href"] ?? "",
91 "target" => $link["Target"] ?? "",
92 "type" => $link["Type"] ?? "",
93 "target_frame" => $link["TargetFrame"] ?? ""
94 ];
95 }
96
97 usort(
98 $data,
99 static fn(array $left, array $right): int => strcasecmp($left["title"], $right["title"])
100 );
101
102 return $this->data = $data;
103 }

References $data, and ILIAS\Repository\int().

+ Here is the call graph for this function:

◆ count()

ILIAS\COPage\PC\MediaObject\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\COPage\PC\MediaObject\ImageMapRetrieval::getData ( array  $fields,
?Range  $range = null,
?Order  $order = null,
array  $filter = [],
array  $parameters = [] 
)

Implements ILIAS\Repository\RetrievalInterface.

Definition at line 35 of file ImageMapRetrieval.php.

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

◆ isFieldNumeric()

ILIAS\COPage\PC\MediaObject\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\COPage\PC\MediaObject\ImageMapRetrieval::$data = null
protected

Definition at line 27 of file ImageMapRetrieval.php.


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