ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\COPage\History\HistoryManager Class Reference
+ Collaboration diagram for ILIAS\COPage\History\HistoryManager:

Public Member Functions

 __construct (InternalDataService $data_service, InternalRepoService $repo_service, InternalDomainService $domain_service)
 
 deleteOldHistoryEntries (int $x_days, int $keep_entries)
 

Protected Member Functions

 deleteHistoryEntriesOlderEqualThanNr (int $delete_lower_than_nr, string $parent_type, int $page_id, string $lang)
 

Protected Attributes

ILIAS COPage PC PCDefinition $pc_definition
 
HistoryDBRepository $history_repo
 

Detailed Description

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

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

Constructor & Destructor Documentation

◆ __construct()

ILIAS\COPage\History\HistoryManager::__construct ( InternalDataService  $data_service,
InternalRepoService  $repo_service,
InternalDomainService  $domain_service 
)

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

39 {
40 $this->history_repo = $repo_service->history();
41 $this->pc_definition = $domain_service
42 ->pc()
43 ->definition();
44 }

References ILIAS\COPage\InternalRepoService\history(), and ILIAS\COPage\InternalDomainService\pc().

+ Here is the call graph for this function:

Member Function Documentation

◆ deleteHistoryEntriesOlderEqualThanNr()

ILIAS\COPage\History\HistoryManager::deleteHistoryEntriesOlderEqualThanNr ( int  $delete_lower_than_nr,
string  $parent_type,
int  $page_id,
string  $lang 
)
protected

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

77 : void {
78 $defs = $this->pc_definition->getPCDefinitions();
79 foreach ($defs as $def) {
80 $cl = $def["pc_class"];
81 $cl::deleteHistoryLowerEqualThan(
82 $parent_type,
83 $page_id,
84 $lang,
85 $delete_lower_than_nr
86 );
87 }
88
89 $this->history_repo->deleteHistoryEntriesOlderEqualThanNr(
90 $delete_lower_than_nr,
91 $parent_type,
92 $page_id,
93 $lang
94 );
95 }
$lang
Definition: xapiexit.php:25

References $lang.

Referenced by ILIAS\COPage\History\HistoryManager\deleteOldHistoryEntries().

+ Here is the caller graph for this function:

◆ deleteOldHistoryEntries()

ILIAS\COPage\History\HistoryManager::deleteOldHistoryEntries ( int  $x_days,
int  $keep_entries 
)
Parameters
int$x_daysdelet entries older than x days
int$keep_entriesentries that should be kept as minimum
Exceptions

ilDateTimeException

Definition at line 51 of file class.HistoryManager.php.

51 : bool
52 {
53 $deleted = false;
54
55 foreach ($this->history_repo->getMaxHistEntryPerPageOlderThanX($x_days) as $page) {
56 $max_deletable = $this->history_repo->getMaxDeletableNr($keep_entries, $page["parent_type"], (int) $page["page_id"], $page["lang"]);
57 $delete_lower_than_nr = min($page["max_nr"], $max_deletable);
58 if ($delete_lower_than_nr > 0) {
60 $delete_lower_than_nr,
61 $page["parent_type"],
62 (int) $page["page_id"],
63 $page["lang"]
64 );
65 $deleted = true;
66 }
67 }
68 return $deleted;
69 }
deleteHistoryEntriesOlderEqualThanNr(int $delete_lower_than_nr, string $parent_type, int $page_id, string $lang)

References ILIAS\COPage\History\HistoryManager\deleteHistoryEntriesOlderEqualThanNr().

+ Here is the call graph for this function:

Field Documentation

◆ $history_repo

HistoryDBRepository ILIAS\COPage\History\HistoryManager::$history_repo
protected

Definition at line 33 of file class.HistoryManager.php.

◆ $pc_definition

ILIAS COPage PC PCDefinition ILIAS\COPage\History\HistoryManager::$pc_definition
protected

Definition at line 32 of file class.HistoryManager.php.


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