Skip to content

Commit

Permalink
Some Code docs
Browse files Browse the repository at this point in the history
  • Loading branch information
PM84 committed Jan 4, 2025
1 parent fa9bf1f commit 4038de0
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions classes/manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
class manager {
/** @var int $contextid */
protected int $contextid = 1;
/** @var array All tables to export data from. **/
/** @var array All tables to export data from. */
protected static $tables = [
'compcat' => 'tiny_c4l_compcat',
'component' => 'tiny_c4l_component',
Expand All @@ -48,10 +48,10 @@ class manager {
'compflavor' => 'tiny_c4l_comp_flavor',
'compvariant' => 'tiny_c4l_comp_variant',
];
/** @var array All tables that are optional. **/
/** @var array All tables that are optional. */
protected static $optionaltables = ['tiny_c4l_comp_flavor', 'tiny_c4l_comp_variant'];

/** @var string Item. **/
/** @var string Item. */
protected static $item = 'row';

/**
Expand Down Expand Up @@ -480,7 +480,6 @@ public static function update_pluginfile_tags(int $oldid, int $newid, string $su
*/
public static function remove_mark(string $subject, string $mark): string {
$newstring = '@@PLUGINFILE@@/1/tiny_c4l/images/';
;
$oldstring = '@@PLUGINFILE@@/1/tiny_c4l/' . $mark . 'images/';
return str_replace($oldstring, $newstring, $subject);
}
Expand Down Expand Up @@ -514,13 +513,18 @@ public function delete_flavor(int $id): void {
$DB->delete_records('tiny_c4l_flavor', ['id' => $id]);
}

/**
/*
* Import data from a zip file.
*
* @param stored_file|string $zip
* @param int $draftitemid
* This method processes the provided zip file, extracts its contents,
* and imports the relevant XML and related category files. It also handles
* the cleanup of temporary files and rebuilds the system caches (CSS and JS).
*
* @param stored_file|string $zip The zip file to import, either as a file object or path.
* @param int $draftitemid The draft item ID associated with the import process (default is 0).
* @return void
*/
public function import(stored_file|string $zip, $draftitemid = 0) {
public function import(stored_file|string $zip, $draftitemid = 0): void {
global $DB;

if (file_exists($zip)) {
Expand Down

0 comments on commit 4038de0

Please sign in to comment.