ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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 ()
 
 __serialize ()
 
 __unserialize (array $data)
 
 getHash ()
 
 equals (Value $other)
 
 getType ()
 
 setParentTask (Task $parentTask)
 
 getParentTask ()
 
 hasParentTask ()
 
 setValue ($value)
 
 __serialize ()
 
 __unserialize (array $data)
 

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 = null
 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.

156 : bool
157 {
158 return strcmp($this->getHash(), $other->getHash());
159 }

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

+ Here is the call graph for this function:

◆ getAdheresToLimit()

ilCopyDefinition::getAdheresToLimit ( )

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

133 {
134 $fallback = new BooleanValue();
135 $fallback->setValue(false);
136 return $this->adheres_to_limit ?? $fallback;
137 }

Referenced by serialize().

+ 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.

65 : array
66 {
68 }

References $copy_definitions.

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

+ 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.

164 : string
165 {
166 return md5($this->serialize());
167 }
serialize()
Serialize content.

References serialize().

Referenced by equals().

+ 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.

112 : int
113 {
114 return $this->num_files;
115 }

References $num_files.

Referenced by serialize().

+ Here is the caller graph for this function:

◆ getObjectRefIds()

ilCopyDefinition::getObjectRefIds ( )
Returns
int[]

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

99 : array
100 {
102 }

References $object_ref_ids.

Referenced by serialize().

+ Here is the caller graph for this function:

◆ getSumFileSizes()

ilCopyDefinition::getSumFileSizes ( )

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

122 : int
123 {
124 return $this->sum_file_sizes ?? 0;
125 }

Referenced by serialize().

+ 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.

82 : string
83 {
84 return $this->temp_dir;
85 }
string $temp_dir
Temporary directory using the normalized title of the bucket.

References $temp_dir.

Referenced by serialize().

+ Here is the caller graph for this function:

◆ serialize()

ilCopyDefinition::serialize ( )

Serialize content.

Returns
string

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

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 }
getCopyDefinitions()
Get copy definitions.
getTempDir()
Get directory name located in /temp/ directory.

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

Referenced by getHash(), and serialize().

+ 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.

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.

References $adheres_to_limit.

Referenced by unserialize().

+ 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.

74 : void
75 {
76 $this->copy_definitions = $a_definitions;
77 }

Referenced by unserialize().

+ Here is the caller graph for this function:

◆ setNumFiles()

ilCopyDefinition::setNumFiles ( int  $num_files)

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

117 : void
118 {
119 $this->num_files = $num_files;
120 }

References $num_files.

Referenced by unserialize().

+ 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.

107 : void
108 {
109 $this->object_ref_ids = $append ? array_merge($this->object_ref_ids, $object_ref_ids) : $object_ref_ids;
110 }

References $object_ref_ids.

Referenced by unserialize().

+ Here is the caller graph for this function:

◆ setSumFileSizes()

ilCopyDefinition::setSumFileSizes ( int  $sum_file_sizes)

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

127 : void
128 {
129 $this->sum_file_sizes = $sum_file_sizes;
130 }

References $sum_file_sizes.

Referenced by unserialize().

+ 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.

91 : void
92 {
93 $this->temp_dir = $temp_dir;
94 }

References $temp_dir.

Referenced by unserialize().

+ 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.

200 : void
201 {
202 $elements = unserialize($serialized);
203
204 $this->setCopyDefinitions($elements["copy_definition"]);
205 $this->setTempDir($elements['temp_dir']);
206 $this->setObjectRefIds(explode(",", (string) $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 }
unserialize($serialized)
Unserialize definitions.
setCopyDefinitions(array $a_definitions)
Set copy definitions.
setTempDir(string $temp_dir)
Set directory name located in /temp/ directory.
setObjectRefIds(array $object_ref_ids, bool $append=false)
setAdheresToLimit(BooleanValue $adheres_to_limit)
setSumFileSizes(int $sum_file_sizes)
setNumFiles(int $num_files)

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

Referenced by unserialize().

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

Field Documentation

◆ $adheres_to_limit

BooleanValue ilCopyDefinition::$adheres_to_limit = null
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: