ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
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
 
const CONTEXT_SEARCH = 6
 

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 32 of file Context.php.

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

Member Function Documentation

◆ __toString()

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

Definition at line 77 of file Context.php.

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

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

◆ getCallingId()

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

Definition at line 48 of file Context.php.

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

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

◆ getContext()

◆ getNode()

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

Definition at line 58 of file Context.php.

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

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

◆ getObjectId()

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

Definition at line 43 of file Context.php.

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

◆ withCallingId()

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

Definition at line 63 of file Context.php.

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

◆ withObjectId()

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

Definition at line 70 of file Context.php.

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

Field Documentation

◆ CONTEXT_REPO

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

◆ CONTEXT_SEARCH

const ILIAS\File\Capabilities\Context::CONTEXT_SEARCH = 6

Definition at line 30 of file Context.php.

Referenced by ILIAS\File\Capabilities\Check\Unzip\maybeUnlock().

◆ CONTEXT_WORKSPACE

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

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