ILIAS  trunk Revision v11.0_alpha-1811-gd2d5443e411
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ILIAS\MetaData\Copyright\Identifiers\Handler Class Reference
+ Inheritance diagram for ILIAS\MetaData\Copyright\Identifiers\Handler:
+ Collaboration diagram for ILIAS\MetaData\Copyright\Identifiers\Handler:

Public Member Functions

 buildIdentifierFromEntryID (int $entry_id)
 
 isIdentifierValid (string $identifier)
 
 parseEntryIDFromIdentifier (string $identifier)
 

Protected Member Functions

 getInstID ()
 

Detailed Description

Definition at line 23 of file Handler.php.

Member Function Documentation

◆ buildIdentifierFromEntryID()

ILIAS\MetaData\Copyright\Identifiers\Handler::buildIdentifierFromEntryID ( int  $entry_id)

Implements ILIAS\MetaData\Copyright\Identifiers\HandlerInterface.

Definition at line 25 of file Handler.php.

References ILIAS\MetaData\Copyright\Identifiers\Handler\getInstID().

25  : string
26  {
27  return 'il_copyright_entry__' . $this->getInstID() . '__' . $entry_id;
28  }
+ Here is the call graph for this function:

◆ getInstID()

ILIAS\MetaData\Copyright\Identifiers\Handler::getInstID ( )
protected

Definition at line 52 of file Handler.php.

References IL_INST_ID.

Referenced by ILIAS\MetaData\Copyright\Identifiers\Handler\buildIdentifierFromEntryID(), ILIAS\MetaData\Copyright\Identifiers\Handler\isIdentifierValid(), and ILIAS\MetaData\Copyright\Identifiers\Handler\parseEntryIDFromIdentifier().

52  : string
53  {
54  return (string) IL_INST_ID;
55  }
const IL_INST_ID
Definition: constants.php:40
+ Here is the caller graph for this function:

◆ isIdentifierValid()

ILIAS\MetaData\Copyright\Identifiers\Handler::isIdentifierValid ( string  $identifier)

Implements ILIAS\MetaData\Copyright\Identifiers\HandlerInterface.

Definition at line 30 of file Handler.php.

References ILIAS\MetaData\Copyright\Identifiers\Handler\getInstID().

30  : bool
31  {
32  if (!preg_match('/il_copyright_entry__([0-9]+)__([0-9]+)/', $identifier, $matches)) {
33  return false;
34  }
35  if (($matches[1] ?? '') !== $this->getInstID()) {
36  return false;
37  }
38  return true;
39  }
+ Here is the call graph for this function:

◆ parseEntryIDFromIdentifier()

ILIAS\MetaData\Copyright\Identifiers\Handler::parseEntryIDFromIdentifier ( string  $identifier)

Implements ILIAS\MetaData\Copyright\Identifiers\HandlerInterface.

Definition at line 41 of file Handler.php.

References ILIAS\MetaData\Copyright\Identifiers\Handler\getInstID().

41  : int
42  {
43  if (!preg_match('/il_copyright_entry__([0-9]+)__([0-9]+)/', $identifier, $matches)) {
44  return 0;
45  }
46  if (($matches[1] ?? '') !== $this->getInstID()) {
47  return 0;
48  }
49  return (int) ($matches[2] ?? 0);
50  }
+ Here is the call graph for this function:

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