ILIAS  trunk Revision v12.0_alpha-16-g3e876e53c80
ILIAS\StaticURL\Shortlinks\TargetLinkResolver Class Reference
+ Collaboration diagram for ILIAS\StaticURL\Shortlinks\TargetLinkResolver:

Public Member Functions

 __construct (private URIBuilder $uri_builder, private DataFactory $data_factory, private ?UIFactory $ui_factory=null,)
 
 resolve (Shortlink $shortlink)
 
 resolveLink (Shortlink $shortlink)
 
 resolveStandardButton (Shortlink $shortlink)
 

Protected Member Functions

 buildName (Shortlink $shortlink)
 

Detailed Description

Author
Fabian Schmid fabia.nosp@m.n@sr.nosp@m..solu.nosp@m.tion.nosp@m.s

Definition at line 36 of file TargetLinkResolver.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\StaticURL\Shortlinks\TargetLinkResolver::__construct ( private URIBuilder  $uri_builder,
private DataFactory  $data_factory,
private ?UIFactory  $ui_factory = null 
)

Definition at line 38 of file TargetLinkResolver.php.

42 {
43 }

Member Function Documentation

◆ buildName()

ILIAS\StaticURL\Shortlinks\TargetLinkResolver::buildName ( Shortlink  $shortlink)
protected

◆ resolve()

ILIAS\StaticURL\Shortlinks\TargetLinkResolver::resolve ( Shortlink  $shortlink)

Definition at line 45 of file TargetLinkResolver.php.

45 : URI|Signal|string|null
46 {
47 $data = $shortlink->getTargetData();
48
49 return match ($shortlink->getTargetType()) {
50 Type::REPO => $this->uri_builder->build(
51 $data['type'],
52 $this->data_factory->refId($data['ref_id'])
53 ),
54 Type::CUSTOM => '#',
55 default => null
56 };
57 }

References $data, ILIAS\StaticURL\Shortlinks\Shortlink\Target\CUSTOM, ILIAS\StaticURL\Shortlinks\Shortlink\Shortlink\getTargetData(), and ILIAS\StaticURL\Shortlinks\Shortlink\Shortlink\getTargetType().

Referenced by ILIAS\StaticURL\Shortlinks\TargetLinkResolver\resolveLink(), and ILIAS\StaticURL\Shortlinks\TargetLinkResolver\resolveStandardButton().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resolveLink()

ILIAS\StaticURL\Shortlinks\TargetLinkResolver::resolveLink ( Shortlink  $shortlink)

Definition at line 69 of file TargetLinkResolver.php.

69 : ?Link
70 {
71 if ($this->ui_factory === null) {
72 return null;
73 }
74
75 return $this->ui_factory->link()->standard(
76 $this->buildName($shortlink),
77 (string) $this->resolve($shortlink),
78 );
79 }

References ILIAS\StaticURL\Shortlinks\TargetLinkResolver\buildName(), and ILIAS\StaticURL\Shortlinks\TargetLinkResolver\resolve().

+ Here is the call graph for this function:

◆ resolveStandardButton()

ILIAS\StaticURL\Shortlinks\TargetLinkResolver::resolveStandardButton ( Shortlink  $shortlink)

Definition at line 81 of file TargetLinkResolver.php.

81 : ?Button
82 {
83 return $this->ui_factory->button()->standard(
84 $this->buildName($shortlink),
85 $this->resolve($shortlink),
86 );
87 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: Bulky.php:21

References ILIAS\StaticURL\Shortlinks\TargetLinkResolver\buildName(), and ILIAS\StaticURL\Shortlinks\TargetLinkResolver\resolve().

+ Here is the call graph for this function:

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