ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilCopyDefinition Class Reference

Description of class class. More...

+ Inheritance diagram for ilCopyDefinition:
+ Collaboration diagram for ilCopyDefinition:

Public Member Functions

 getCopyDefinitions ()
 Get copy definitions. More...
 
 setCopyDefinitions (array $a_definitions)
 Set copy definitions. More...
 
 getTempDir ()
 Get directory name located in /temp/ directory. More...
 
 setTempDir (string $temp_dir)
 Set directory name located in /temp/ directory. More...
 
 getObjectRefIds ()
 
 setObjectRefIds (array $object_ref_ids, bool $append=false)
 
 getNumFiles ()
 
 setNumFiles (int $num_files)
 
 getSumFileSizes ()
 
 setSumFileSizes (int $sum_file_sizes)
 
 getAdheresToLimit ()
 
 setAdheresToLimit (BooleanValue $adheres_to_limit)
 
 addCopyDefinition (string $a_source, string $a_target)
 
 equals (Value $other)
 Check equality. More...
 
 getHash ()
 Get hash. More...
 
 serialize ()
 Serialize content. More...
 
 setValue ($value)
 Set value. More...
 
 unserialize ($serialized)
 Unserialize definitions. More...
 
- Public Member Functions inherited from ILIAS\BackgroundTasks\Implementation\Values\AbstractValue
 getType ()
 
 getParentTask ()
 
 setParentTask (Task $parentTask)
 
 hasParentTask ()
 

Data Fields

const COPY_SOURCE_DIR = 'source'
 
const COPY_TARGET_DIR = 'target'
 

Private Attributes

array $copy_definitions = []
 
string $temp_dir
 Temporary directory using the normalized title of the bucket. More...
 
array $object_ref_ids = []
 
int $num_files = 0
 
int $sum_file_sizes = 0
 
BooleanValue $adheres_to_limit
 States if the sum of all file sizes adheres to the global limit. More...
 

Additional Inherited Members

- Protected Attributes inherited from ILIAS\BackgroundTasks\Implementation\Values\AbstractValue
Task $parentTask
 

Detailed Description

Description of class class.

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e

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

Member Function Documentation

◆ addCopyDefinition()

ilCopyDefinition::addCopyDefinition ( string  $a_source,
string  $a_target 
)

Definition at line 144 of file class.ilCopyDefinition.php.

144  : void
145  {
146  $this->copy_definitions[]
147  = [
148  self::COPY_SOURCE_DIR => $a_source,
149  self::COPY_TARGET_DIR => $a_target,
150  ];
151  }

◆ equals()

ilCopyDefinition::equals ( Value  $other)

Check equality.

Implements ILIAS\BackgroundTasks\Value.

Definition at line 156 of file class.ilCopyDefinition.php.

References ILIAS\BackgroundTasks\Value\getHash(), and getHash().

156  : bool
157  {
158  return strcmp($this->getHash(), $other->getHash());
159  }
+ Here is the call graph for this function:

◆ getAdheresToLimit()

ilCopyDefinition::getAdheresToLimit ( )

Definition at line 132 of file class.ilCopyDefinition.php.

Referenced by serialize().

132  : BooleanValue
133  {
134  $fallback = new BooleanValue();
135  $fallback->setValue(false);
136  return $this->adheres_to_limit ?? $fallback;
137  }
+ Here is the caller graph for this function:

◆ getCopyDefinitions()

ilCopyDefinition::getCopyDefinitions ( )

Get copy definitions.

Returns
array<string, string>[]|string[]

Definition at line 65 of file class.ilCopyDefinition.php.

References $copy_definitions.

Referenced by ilCopyFilesToTempDirectoryJob\copyFiles(), and serialize().

65  : array
66  {
68  }
+ Here is the caller graph for this function:

◆ getHash()

ilCopyDefinition::getHash ( )

Get hash.

Implements ILIAS\BackgroundTasks\Value.

Definition at line 164 of file class.ilCopyDefinition.php.

References serialize().

Referenced by equals().

164  : string
165  {
166  return md5($this->serialize());
167  }
serialize()
Serialize content.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getNumFiles()

ilCopyDefinition::getNumFiles ( )

Definition at line 112 of file class.ilCopyDefinition.php.

References $num_files.

Referenced by serialize().

112  : int
113  {
114  return $this->num_files;
115  }
+ Here is the caller graph for this function:

◆ getObjectRefIds()

ilCopyDefinition::getObjectRefIds ( )
Returns
int[]

Definition at line 99 of file class.ilCopyDefinition.php.

References $object_ref_ids.

Referenced by serialize().

99  : array
100  {
101  return $this->object_ref_ids;
102  }
+ Here is the caller graph for this function:

◆ getSumFileSizes()

ilCopyDefinition::getSumFileSizes ( )

Definition at line 122 of file class.ilCopyDefinition.php.

Referenced by serialize().

122  : int
123  {
124  return $this->sum_file_sizes ?? 0;
125  }
+ Here is the caller graph for this function:

◆ getTempDir()

ilCopyDefinition::getTempDir ( )

Get directory name located in /temp/ directory.

Definition at line 82 of file class.ilCopyDefinition.php.

References $temp_dir.

Referenced by serialize().

82  : string
83  {
84  return $this->temp_dir;
85  }
string $temp_dir
Temporary directory using the normalized title of the bucket.
+ Here is the caller graph for this function:

◆ serialize()

ilCopyDefinition::serialize ( )

Serialize content.

Returns
string

Definition at line 173 of file class.ilCopyDefinition.php.

References getAdheresToLimit(), getCopyDefinitions(), getNumFiles(), getObjectRefIds(), getSumFileSizes(), and getTempDir().

Referenced by getHash().

174  {
175  return serialize(
176  [
177  "copy_definition" => $this->getCopyDefinitions(),
178  "temp_dir" => $this->getTempDir(),
179  "object_ref_ids" => implode(",", $this->getObjectRefIds()),
180  "num_files" => $this->getNumFiles(),
181  "sum_file_sizes" => $this->getSumFileSizes(),
182  "adheres_to_limit" => $this->getAdheresToLimit(),
183  ]
184  );
185  }
serialize()
Serialize content.
getCopyDefinitions()
Get copy definitions.
getTempDir()
Get directory name located in /temp/ directory.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setAdheresToLimit()

ilCopyDefinition::setAdheresToLimit ( BooleanValue  $adheres_to_limit)

Definition at line 139 of file class.ilCopyDefinition.php.

References $adheres_to_limit.

Referenced by unserialize().

139  : void
140  {
141  $this->adheres_to_limit = $adheres_to_limit;
142  }
BooleanValue $adheres_to_limit
States if the sum of all file sizes adheres to the global limit.
+ Here is the caller graph for this function:

◆ setCopyDefinitions()

ilCopyDefinition::setCopyDefinitions ( array  $a_definitions)

Set copy definitions.

Parameters
string[]$a_definitions

Definition at line 74 of file class.ilCopyDefinition.php.

Referenced by unserialize().

74  : void
75  {
76  $this->copy_definitions = $a_definitions;
77  }
+ Here is the caller graph for this function:

◆ setNumFiles()

ilCopyDefinition::setNumFiles ( int  $num_files)

Definition at line 117 of file class.ilCopyDefinition.php.

References $num_files.

Referenced by unserialize().

117  : void
118  {
119  $this->num_files = $num_files;
120  }
+ Here is the caller graph for this function:

◆ setObjectRefIds()

ilCopyDefinition::setObjectRefIds ( array  $object_ref_ids,
bool  $append = false 
)
Parameters
int[]$object_ref_ids

Definition at line 107 of file class.ilCopyDefinition.php.

References $object_ref_ids.

Referenced by unserialize().

107  : void
108  {
109  $this->object_ref_ids = $append ? array_merge($this->object_ref_ids, $object_ref_ids) : $object_ref_ids;
110  }
+ Here is the caller graph for this function:

◆ setSumFileSizes()

ilCopyDefinition::setSumFileSizes ( int  $sum_file_sizes)

Definition at line 127 of file class.ilCopyDefinition.php.

References $sum_file_sizes.

Referenced by unserialize().

127  : void
128  {
129  $this->sum_file_sizes = $sum_file_sizes;
130  }
+ Here is the caller graph for this function:

◆ setTempDir()

ilCopyDefinition::setTempDir ( string  $temp_dir)

Set directory name located in /temp/ directory.

Parameters
$temp_dir

Definition at line 91 of file class.ilCopyDefinition.php.

References $temp_dir.

Referenced by unserialize().

91  : void
92  {
93  $this->temp_dir = $temp_dir;
94  }
string $temp_dir
Temporary directory using the normalized title of the bucket.
+ Here is the caller graph for this function:

◆ setValue()

ilCopyDefinition::setValue (   $value)

Set value.

Parameters
$value

Implements ILIAS\BackgroundTasks\Value.

Definition at line 191 of file class.ilCopyDefinition.php.

191  : void
192  {
193  $this->copy_definitions = $value;
194  }

◆ unserialize()

ilCopyDefinition::unserialize (   $serialized)

Unserialize definitions.

Parameters
string$serialized

Definition at line 200 of file class.ilCopyDefinition.php.

References setAdheresToLimit(), setCopyDefinitions(), setNumFiles(), setObjectRefIds(), setSumFileSizes(), and setTempDir().

201  {
202  $elements = unserialize($serialized);
203 
204  $this->setCopyDefinitions($elements["copy_definition"]);
205  $this->setTempDir($elements['temp_dir']);
206  $this->setObjectRefIds(explode(",", $elements["object_ref_ids"]));
207  $this->setNumFiles($elements["num_files"]);
208  $this->setSumFileSizes($elements["sum_file_sizes"]);
209  $this->setAdheresToLimit($elements["adheres_to_limit"]);
210  }
setSumFileSizes(int $sum_file_sizes)
setAdheresToLimit(BooleanValue $adheres_to_limit)
unserialize($serialized)
Unserialize definitions.
setObjectRefIds(array $object_ref_ids, bool $append=false)
setTempDir(string $temp_dir)
Set directory name located in /temp/ directory.
setCopyDefinitions(array $a_definitions)
Set copy definitions.
setNumFiles(int $num_files)
+ Here is the call graph for this function:

Field Documentation

◆ $adheres_to_limit

BooleanValue ilCopyDefinition::$adheres_to_limit
private

States if the sum of all file sizes adheres to the global limit.

Definition at line 59 of file class.ilCopyDefinition.php.

Referenced by setAdheresToLimit().

◆ $copy_definitions

array ilCopyDefinition::$copy_definitions = []
private

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

Referenced by getCopyDefinitions().

◆ $num_files

int ilCopyDefinition::$num_files = 0
private

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

Referenced by getNumFiles(), and setNumFiles().

◆ $object_ref_ids

array ilCopyDefinition::$object_ref_ids = []
private

Definition at line 45 of file class.ilCopyDefinition.php.

Referenced by getObjectRefIds(), and setObjectRefIds().

◆ $sum_file_sizes

int ilCopyDefinition::$sum_file_sizes = 0
private

Definition at line 55 of file class.ilCopyDefinition.php.

Referenced by setSumFileSizes().

◆ $temp_dir

string ilCopyDefinition::$temp_dir
private

Temporary directory using the normalized title of the bucket.

Definition at line 40 of file class.ilCopyDefinition.php.

Referenced by getTempDir(), and setTempDir().

◆ COPY_SOURCE_DIR

const ilCopyDefinition::COPY_SOURCE_DIR = 'source'

Definition at line 29 of file class.ilCopyDefinition.php.

Referenced by ilCopyFilesToTempDirectoryJob\copyFiles().

◆ COPY_TARGET_DIR

const ilCopyDefinition::COPY_TARGET_DIR = 'target'

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

Referenced by ilCopyFilesToTempDirectoryJob\copyFiles().


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