ILIAS  trunk Revision v11.0_alpha-1831-g8615d53dadb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilWebLinkItem Class Reference

Immutable class for Web Link items. More...

+ Inheritance diagram for ilWebLinkItem:
+ Collaboration diagram for ilWebLinkItem:

Public Member Functions

 __construct (int $webr_id, int $link_id, string $title, ?string $description, string $target, bool $active, DateTimeImmutable $create_date, DateTimeImmutable $last_update, array $parameters)
 
 getResolvedLink (bool $with_parameters=true)
 
 isInternal ()
 
 toXML (ilXmlWriter $writer, int $position)
 
 getWebrId ()
 
 getLinkId ()
 
 getCreateDate ()
 
 getLastUpdate ()
 
 getParameters ()
 
- Public Member Functions inherited from ilWebLinkBaseItem
 __construct (string $title, ?string $description, string $target, bool $active, array $parameters)
 
 isInternal ()
 
 getTitle ()
 
 getDescription ()
 
 getTarget ()
 
 isActive ()
 
 getParameters ()
 

Protected Attributes

int $webr_id
 
int $link_id
 
DateTimeImmutable $create_date
 
DateTimeImmutable $last_update
 
array $parameters
 
- Protected Attributes inherited from ilWebLinkBaseItem
string $title
 
string $target
 
bool $active
 
array $parameters
 
string $description
 

Detailed Description

Immutable class for Web Link items.

Author
Tim Schmitz schmi.nosp@m.tz@l.nosp@m.eifos.nosp@m..de

Definition at line 25 of file class.ilWebLinkItem.php.

Constructor & Destructor Documentation

◆ __construct()

ilWebLinkItem::__construct ( int  $webr_id,
int  $link_id,
string  $title,
?string  $description,
string  $target,
bool  $active,
DateTimeImmutable  $create_date,
DateTimeImmutable  $last_update,
array  $parameters 
)
Parameters
int$webr_id
int$link_id
string$title
string | null$description
string$target
bool$active
DateTimeImmutable$create_date
DateTimeImmutable$last_update
ilWebLinkParameter[]$parameters

Definition at line 49 of file class.ilWebLinkItem.php.

References $create_date, $last_update, $link_id, $webr_id, ILIAS\GlobalScreen\Provider\__construct(), getResolvedLink(), and isInternal().

59  {
61  $this->webr_id = $webr_id;
62  $this->link_id = $link_id;
63  $this->create_date = $create_date;
64  $this->last_update = $last_update;
65  }
DateTimeImmutable $create_date
DateTimeImmutable $last_update
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ getCreateDate()

ilWebLinkItem::getCreateDate ( )

Definition at line 103 of file class.ilWebLinkItem.php.

References $create_date.

104  {
105  return $this->create_date;
106  }
DateTimeImmutable $create_date

◆ getLastUpdate()

ilWebLinkItem::getLastUpdate ( )

Definition at line 108 of file class.ilWebLinkItem.php.

References $last_update.

109  {
110  return $this->last_update;
111  }
DateTimeImmutable $last_update

◆ getLinkId()

ilWebLinkItem::getLinkId ( )

Definition at line 98 of file class.ilWebLinkItem.php.

References $link_id.

Referenced by ilWebLinkDatabaseRepository\getParameterinItemByParamId(), toXML(), and ilWebLinkDatabaseRepository\updateItem().

98  : int
99  {
100  return $this->link_id;
101  }
+ Here is the caller graph for this function:

◆ getParameters()

ilWebLinkItem::getParameters ( )
Returns
ilWebLinkParameter[]

Definition at line 116 of file class.ilWebLinkItem.php.

References $parameters.

Referenced by ilWebLinkItemExternal\getResolvedLink(), ilWebLinkItemInternal\getResolvedLink(), toXML(), and ilWebLinkDatabaseRepository\updateItem().

116  : array
117  {
118  return $this->parameters;
119  }
+ Here is the caller graph for this function:

◆ getResolvedLink()

ilWebLinkItem::getResolvedLink ( bool  $with_parameters = true)
abstract

Referenced by __construct().

+ Here is the caller graph for this function:

◆ getWebrId()

ilWebLinkItem::getWebrId ( )

Definition at line 93 of file class.ilWebLinkItem.php.

References $webr_id.

Referenced by ilWebLinkDatabaseRepository\updateItem().

93  : int
94  {
95  return $this->webr_id;
96  }
+ Here is the caller graph for this function:

◆ isInternal()

ilWebLinkItem::isInternal ( )
abstract

Referenced by __construct(), and toXML().

+ Here is the caller graph for this function:

◆ toXML()

ilWebLinkItem::toXML ( ilXmlWriter  $writer,
int  $position 
)

Definition at line 71 of file class.ilWebLinkItem.php.

References ilWebLinkBaseItem\getDescription(), getLinkId(), getParameters(), ilWebLinkBaseItem\getTarget(), ilWebLinkBaseItem\getTitle(), ilWebLinkBaseItem\isActive(), isInternal(), ilXmlWriter\xmlElement(), ilXmlWriter\xmlEndTag(), and ilXmlWriter\xmlStartTag().

71  : void
72  {
73  $writer->xmlStartTag(
74  'WebLink',
75  [
76  'id' => $this->getLinkId(),
77  'active' => (int) $this->isActive(),
78  'position' => $position,
79  'internal' => (int) $this->isInternal(),
80  ]
81  );
82  $writer->xmlElement('Title', [], $this->getTitle());
83  $writer->xmlElement('Description', [], $this->getDescription());
84  $writer->xmlElement('Target', [], $this->getTarget());
85 
86  foreach ($this->getParameters() as $parameter) {
87  $parameter->toXML($writer);
88  }
89 
90  $writer->xmlEndTag('WebLink');
91  }
xmlEndTag(string $tag)
Writes an endtag.
xmlStartTag(string $tag, ?array $attrs=null, bool $empty=false, bool $encode=true, bool $escape=true)
Writes a starttag.
xmlElement(string $tag, $attrs=null, $data=null, $encode=true, $escape=true)
Writes a basic element (no children, just textual content)
+ Here is the call graph for this function:

Field Documentation

◆ $create_date

DateTimeImmutable ilWebLinkItem::$create_date
protected

Definition at line 30 of file class.ilWebLinkItem.php.

Referenced by __construct(), and getCreateDate().

◆ $last_update

DateTimeImmutable ilWebLinkItem::$last_update
protected

Definition at line 31 of file class.ilWebLinkItem.php.

Referenced by __construct(), and getLastUpdate().

◆ $link_id

int ilWebLinkItem::$link_id
protected

Definition at line 28 of file class.ilWebLinkItem.php.

Referenced by __construct(), and getLinkId().

◆ $parameters

array ilWebLinkItem::$parameters
protected

Definition at line 36 of file class.ilWebLinkItem.php.

Referenced by getParameters().

◆ $webr_id

int ilWebLinkItem::$webr_id
protected

Definition at line 27 of file class.ilWebLinkItem.php.

Referenced by __construct(), and getWebrId().


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