ILIAS  release_7 Revision v7.30-3-g800a261c036
ilExportLimitation Class Reference

Export limitation checker. More...

+ Collaboration diagram for ilExportLimitation:

Public Member Functions

 __construct ()
 Constructor. More...
 
 getLimitationMode ()
 Get limitation mode. More...
 
 getLimitationNumber ()
 Get limitation number. More...
 
 checkLimitation ($ref_id, $options)
 

Data Fields

const SET_LIMIT_NUMBER = "rep_export_limit_number"
 
const SET_LIMITATION = "rep_export_limitation"
 
const SET_EXPORT_DISABLED = 1
 
const SET_EXPORT_LIMITED = 0
 

Protected Attributes

 $tree
 
 $settings
 
 $lng
 

Detailed Description

Export limitation checker.

Author
killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 10 of file class.ilExportLimitation.php.

Constructor & Destructor Documentation

◆ __construct()

ilExportLimitation::__construct ( )

Constructor.

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

37 {
38 global $DIC;
39
40 $this->tree = $DIC->repositoryTree();
41 $this->settings = $DIC->settings();
42 $this->lng = $DIC->language();
43 }
global $DIC
Definition: goto.php:24
settings()
Definition: settings.php:2

References $DIC, and settings().

+ Here is the call graph for this function:

Member Function Documentation

◆ checkLimitation()

ilExportLimitation::checkLimitation (   $ref_id,
  $options 
)
Parameters
$ref_id
$options
Exceptions
ilExportLimitationExceptionException

Definition at line 70 of file class.ilExportLimitation.php.

71 {
75
76 $max = (int) $settings->get(self::SET_LIMIT_NUMBER);
77
80 $lng->txt("exp_error_disabled")
81 );
82 }
83
84 $cnt = 0;
85 foreach ($tree->getSubTree($root = $tree->getNodeData($ref_id)) as $node) {
86 if (isset($options[$node["child"]]) && (in_array((int) $options[$node["child"]]["type"], [1,2]))) {
87 $cnt++;
88 }
89 }
90 if ($max > 0 && $cnt > $max) {
91 throw new ilExportLimitationExceptionException(str_replace(
92 "%1",
93 $max,
94 $lng->txt("exp_error_too_many_objects")
95 ));
96 }
97 }
getLimitationMode()
Get limitation mode.

References $lng, $settings, $tree, getLimitationMode(), and SET_EXPORT_DISABLED.

+ Here is the call graph for this function:

◆ getLimitationMode()

ilExportLimitation::getLimitationMode ( )

Get limitation mode.

Returns
int

Definition at line 50 of file class.ilExportLimitation.php.

51 {
52 return (int) $this->settings->get(self::SET_LIMITATION);
53 }

References settings().

Referenced by checkLimitation().

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

◆ getLimitationNumber()

ilExportLimitation::getLimitationNumber ( )

Get limitation number.

Returns
int

Definition at line 60 of file class.ilExportLimitation.php.

61 {
62 return (int) $this->settings->get(self::SET_LIMIT_NUMBER);
63 }

References settings().

+ Here is the call graph for this function:

Field Documentation

◆ $lng

ilExportLimitation::$lng
protected

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

Referenced by checkLimitation().

◆ $settings

ilExportLimitation::$settings
protected

Definition at line 26 of file class.ilExportLimitation.php.

Referenced by checkLimitation().

◆ $tree

ilExportLimitation::$tree
protected

Definition at line 21 of file class.ilExportLimitation.php.

Referenced by checkLimitation().

◆ SET_EXPORT_DISABLED

const ilExportLimitation::SET_EXPORT_DISABLED = 1

◆ SET_EXPORT_LIMITED

const ilExportLimitation::SET_EXPORT_LIMITED = 0

◆ SET_LIMIT_NUMBER

const ilExportLimitation::SET_LIMIT_NUMBER = "rep_export_limit_number"

Definition at line 12 of file class.ilExportLimitation.php.

◆ SET_LIMITATION

const ilExportLimitation::SET_LIMITATION = "rep_export_limitation"

Definition at line 13 of file class.ilExportLimitation.php.


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