ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 ($a_definitions)
 Set copy definitions. More...
 
 getTempDir ()
 Get directory name located in /temp/ directory. More...
 
 setTempDir ($temp_dir)
 Set directory name located in /temp/ directory. More...
 
 getObjectRefIds ()
 
 setObjectRefIds ($object_ref_ids, $append=false)
 
 getNumFiles ()
 
 setNumFiles ($num_files)
 
 getSumFileSizes ()
 
 setSumFileSizes ($sum_file_sizes)
 
 getAdheresToLimit ()
 
 setAdheresToLimit ($adheres_to_limit)
 
 addCopyDefinition ($a_source, $a_target)
 Add copy definition. More...
 
 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

 $copy_definitions = []
 Copy Jobs: source file => relative target file in zip directory. More...
 
 $temp_dir
 
 $object_ref_ids = []
 
 $num_files = 0
 
 $sum_file_sizes = 0
 
 $adheres_to_limit = false
 

Additional Inherited Members

- Protected Attributes inherited from ILIAS\BackgroundTasks\Implementation\Values\AbstractValue
 $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 14 of file class.ilCopyDefinition.php.

Member Function Documentation

◆ addCopyDefinition()

ilCopyDefinition::addCopyDefinition (   $a_source,
  $a_target 
)

Add copy definition.

Parameters
string$a_source
string$a_target

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

184  {
185  $this->copy_definitions[]
186  = [
187  self::COPY_SOURCE_DIR => $a_source,
188  self::COPY_TARGET_DIR => $a_target,
189  ];
190  }

◆ equals()

ilCopyDefinition::equals ( Value  $other)

Check equality.

Parameters
Value$other
Returns
bool

Implements ILIAS\BackgroundTasks\Value.

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

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

201  {
202  return strcmp($this->getHash(), $other->getHash());
203  }
+ Here is the call graph for this function:

◆ getAdheresToLimit()

ilCopyDefinition::getAdheresToLimit ( )
Returns
bool

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

References $adheres_to_limit.

Referenced by serialize().

163  {
165  }
+ Here is the caller graph for this function:

◆ getCopyDefinitions()

ilCopyDefinition::getCopyDefinitions ( )

Get copy definitions.

Returns
string[]

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

References $copy_definitions.

Referenced by serialize().

62  {
64  }
$copy_definitions
Copy Jobs: source file => relative target file in zip directory.
+ Here is the caller graph for this function:

◆ getHash()

ilCopyDefinition::getHash ( )

Get hash.

Returns
string

Implements ILIAS\BackgroundTasks\Value.

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

References serialize().

Referenced by equals().

212  {
213  return md5($this->serialize());
214  }
serialize()
Serialize content.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getNumFiles()

ilCopyDefinition::getNumFiles ( )
Returns
int

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

References $num_files.

Referenced by serialize().

127  {
128  return $this->num_files;
129  }
+ Here is the caller graph for this function:

◆ getObjectRefIds()

ilCopyDefinition::getObjectRefIds ( )
Returns
string[]

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

References $object_ref_ids.

Referenced by serialize().

104  {
105  return $this->object_ref_ids;
106  }
+ Here is the caller graph for this function:

◆ getSumFileSizes()

ilCopyDefinition::getSumFileSizes ( )
Returns
int

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

References $sum_file_sizes.

Referenced by serialize().

145  {
146  return $this->sum_file_sizes;
147  }
+ Here is the caller graph for this function:

◆ getTempDir()

ilCopyDefinition::getTempDir ( )

Get directory name located in /temp/ directory.

Returns
string

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

References $temp_dir.

Referenced by serialize().

84  {
85  return $this->temp_dir;
86  }
+ Here is the caller graph for this function:

◆ serialize()

ilCopyDefinition::serialize ( )

Serialize content.

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

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

Referenced by getHash().

221  {
222  return serialize(
223  [
224  "copy_definition" => $this->getCopyDefinitions(),
225  "temp_dir" => $this->getTempDir(),
226  "object_ref_ids" => implode(",", $this->getObjectRefIds()),
227  "num_files" => $this->getNumFiles(),
228  "sum_file_sizes" => $this->getSumFileSizes(),
229  "adheres_to_limit" => $this->getAdheresToLimit(),
230  ]
231  );
232  }
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 (   $adheres_to_limit)
Parameters
bool$adheres_to_limit

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

References $adheres_to_limit.

Referenced by unserialize().

172  {
173  $this->adheres_to_limit = $adheres_to_limit;
174  }
+ Here is the caller graph for this function:

◆ setCopyDefinitions()

ilCopyDefinition::setCopyDefinitions (   $a_definitions)

Set copy definitions.

Parameters
string[]$a_definitions

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

Referenced by unserialize().

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

◆ setNumFiles()

ilCopyDefinition::setNumFiles (   $num_files)
Parameters
$num_files

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

References $num_files.

Referenced by unserialize().

136  {
137  $this->num_files = $num_files;
138  }
+ Here is the caller graph for this function:

◆ setObjectRefIds()

ilCopyDefinition::setObjectRefIds (   $object_ref_ids,
  $append = false 
)
Parameters
$object_ref_ids
$append

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

References $object_ref_ids.

Referenced by unserialize().

114  {
115  if ($append) {
116  array_merge($this->object_ref_ids, $object_ref_ids);
117  } else {
118  $this->object_ref_ids = $object_ref_ids;
119  }
120  }
+ Here is the caller graph for this function:

◆ setSumFileSizes()

ilCopyDefinition::setSumFileSizes (   $sum_file_sizes)
Parameters
int$sum_file_sizes

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

References $sum_file_sizes.

Referenced by unserialize().

154  {
155  $this->sum_file_sizes = $sum_file_sizes;
156  }
+ Here is the caller graph for this function:

◆ setTempDir()

ilCopyDefinition::setTempDir (   $temp_dir)

Set directory name located in /temp/ directory.

Parameters
$temp_dir

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

References $temp_dir.

Referenced by unserialize().

95  {
96  $this->temp_dir = $temp_dir;
97  }
+ Here is the caller graph for this function:

◆ setValue()

ilCopyDefinition::setValue (   $value)

Set value.

Parameters
string[]$value

Implements ILIAS\BackgroundTasks\Value.

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

241  {
242  $this->copy_definitions = $value;
243  }

◆ unserialize()

ilCopyDefinition::unserialize (   $serialized)

Unserialize definitions.

Parameters
string$serialized

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

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

252  {
253  $elements = unserialize($serialized);
254 
255  $this->setCopyDefinitions($elements["copy_definition"]);
256  $this->setTempDir($elements['temp_dir']);
257  $this->setObjectRefIds(explode(",", $elements["object_ref_ids"]));
258  $this->setNumFiles($elements["num_files"]);
259  $this->setSumFileSizes($elements["sum_file_sizes"]);
260  $this->setAdheresToLimit($elements["adheres_to_limit"]);
261  }
unserialize($serialized)
Unserialize definitions.
setAdheresToLimit($adheres_to_limit)
setTempDir($temp_dir)
Set directory name located in /temp/ directory.
setCopyDefinitions($a_definitions)
Set copy definitions.
setObjectRefIds($object_ref_ids, $append=false)
setSumFileSizes($sum_file_sizes)
+ Here is the call graph for this function:

Field Documentation

◆ $adheres_to_limit

ilCopyDefinition::$adheres_to_limit = false
private

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

Referenced by getAdheresToLimit(), and setAdheresToLimit().

◆ $copy_definitions

ilCopyDefinition::$copy_definitions = []
private

Copy Jobs: source file => relative target file in zip directory.

Parameters
string[]

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

Referenced by getCopyDefinitions().

◆ $num_files

ilCopyDefinition::$num_files = 0
private

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

Referenced by getNumFiles(), and setNumFiles().

◆ $object_ref_ids

ilCopyDefinition::$object_ref_ids = []
private

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

Referenced by getObjectRefIds(), and setObjectRefIds().

◆ $sum_file_sizes

ilCopyDefinition::$sum_file_sizes = 0
private

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

Referenced by getSumFileSizes(), and setSumFileSizes().

◆ $temp_dir

ilCopyDefinition::$temp_dir
private

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

Referenced by getTempDir(), and setTempDir().

◆ COPY_SOURCE_DIR

const ilCopyDefinition::COPY_SOURCE_DIR = 'source'

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

◆ COPY_TARGET_DIR

const ilCopyDefinition::COPY_TARGET_DIR = 'target'

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


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