ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
class.ilCalendarCopyDefinition.php
Go to the documentation of this file.
1<?php
2
5
6/* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
7
15{
16 const COPY_SOURCE_DIR = 'source';
17 const COPY_TARGET_DIR = 'target';
18
23 private $copy_definitions = [];
24
29 private $temp_dir;
30
31
32
37 public function getCopyDefinitions()
38 {
40 }
41
46 public function setCopyDefinitions($a_definitions)
47 {
48 $this->copy_definitions = $a_definitions;
49 }
50
55 public function getTempDir()
56 {
57 return $this->temp_dir;
58 }
59
64 public function setTempDir($temp_dir)
65 {
66 $this->temp_dir = $temp_dir;
67 }
68
74 public function addCopyDefinition($a_source, $a_target)
75 {
76 $this->copy_definitions[] =
77 [
78 self::COPY_SOURCE_DIR => $a_source,
79 self::COPY_TARGET_DIR => $a_target
80 ];
81 }
82
83
89 public function equals(Value $other)
90 {
91 return strcmp($this->getHash(), $other->getHash());
92 }
93
94
99 public function getHash()
100 {
101 return md5($this->serialize());
102 }
103
107 public function serialize()
108 {
109 return serialize(
110 [
111 "copy_definition" => $this->getCopyDefinitions(),
112 "temp_dir" => $this->getTempDir()
113 ]
114 );
115 }
116
121 public function setValue($value)
122 {
123 $this->copy_definitions = $value;
124 }
125
130 public function unserialize($serialized)
131 {
132 $elements = unserialize($serialized);
133
134 $this->setCopyDefinitions($elements["copy_definition"]);
135 $this->setTempDir($elements['temp_dir']);
136 }
137}
An exception for terminatinating execution or to throw for unit testing.
equals(Value $other)
Check equality.
unserialize($serialized)
Unserialize definitions.
setTempDir($temp_dir)
Set directory name located in /temp/ directory.
$copy_definitions
Copy Jobs: source file => relative target file in zip directory.
setCopyDefinitions($a_definitions)
Set copy definitions.
addCopyDefinition($a_source, $a_target)
Add copy definition.
getTempDir()
Get directory name located in /temp/ directory.