ILIAS  trunk Revision v11.0_alpha-1831-g8615d53dadb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ILIAS\File\Capabilities\Context Class Reference
+ Inheritance diagram for ILIAS\File\Capabilities\Context:
+ Collaboration diagram for ILIAS\File\Capabilities\Context:

Public Member Functions

 __construct (private int $object_id, private int $calling_id, private int $context)
 
 getObjectId ()
 
 getCallingId ()
 
 getContext ()
 
 getNode ()
 
 withCallingId (int $calling_id)
 
 withObjectId (int $object_id)
 
 __toString ()
 

Data Fields

const CONTEXT_REPO = 1
 
const CONTEXT_WORKSPACE = 2
 

Detailed Description

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

Definition at line 26 of file Context.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\File\Capabilities\Context::__construct ( private int  $object_id,
private int  $calling_id,
private int  $context 
)

Definition at line 31 of file Context.php.

35  {
36  // $context mut be one of the constants
37  if ($context !== self::CONTEXT_REPO && $context !== self::CONTEXT_WORKSPACE) {
38  throw new \InvalidArgumentException('Invalid context');
39  }
40  }
$context
Definition: webdav.php:31

Member Function Documentation

◆ __toString()

ILIAS\File\Capabilities\Context::__toString ( )

Definition at line 76 of file Context.php.

References ILIAS\File\Capabilities\Context\getCallingId().

76  : string
77  {
78  return (string) $this->getCallingId();
79  }
+ Here is the call graph for this function:

◆ getCallingId()

ILIAS\File\Capabilities\Context::getCallingId ( )

Definition at line 47 of file Context.php.

Referenced by ILIAS\File\Capabilities\Context\__toString(), ILIAS\File\Capabilities\Context\getNode(), and ILIAS\File\Capabilities\Check\BaseCheck\hasPermission().

47  : int
48  {
49  return $this->calling_id;
50  }
+ Here is the caller graph for this function:

◆ getContext()

ILIAS\File\Capabilities\Context::getContext ( )

◆ getNode()

ILIAS\File\Capabilities\Context::getNode ( )

Definition at line 57 of file Context.php.

References ILIAS\File\Capabilities\Context\getCallingId(), and ILIAS\File\Capabilities\Context\getContext().

57  : string
58  {
59  return $this->getContext() . '_' . $this->getCallingId();
60  }
+ Here is the call graph for this function:

◆ getObjectId()

ILIAS\File\Capabilities\Context::getObjectId ( )

Definition at line 42 of file Context.php.

42  : int
43  {
44  return $this->object_id;
45  }

◆ withCallingId()

ILIAS\File\Capabilities\Context::withCallingId ( int  $calling_id)

Definition at line 62 of file Context.php.

62  : self
63  {
64  $clone = clone $this;
65  $clone->calling_id = $calling_id;
66  return $clone;
67  }

◆ withObjectId()

ILIAS\File\Capabilities\Context::withObjectId ( int  $object_id)

Definition at line 69 of file Context.php.

69  : self
70  {
71  $clone = clone $this;
72  $clone->object_id = $object_id;
73  return $clone;
74  }

Field Documentation

◆ CONTEXT_REPO

const ILIAS\File\Capabilities\Context::CONTEXT_REPO = 1

◆ CONTEXT_WORKSPACE

const ILIAS\File\Capabilities\Context::CONTEXT_WORKSPACE = 2

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