Function Hook_task_import_catalogue->run
Definitions
sources/hooks/systems/tasks/import_catalogue.php
- Run the task hook.
- Visibility: public
- Is abstract?: No
- Is static?: No
- Is final?: No
- Returns: array
Parameters
| Name | Type | Passed by reference? | Variadic? | Default | Set | Range | Description |
|---|---|---|---|---|---|---|---|
| $catalogue_name | ID_TEXT | No | No | required parameter | N/A | N/A | The name of the catalogue that was used |
| $key_field | string | No | No | required parameter | N/A | N/A | The title of the key field (blank: none) |
| $new_handling | ID_TEXT | No | No | required parameter | skip add | N/A | New handling method |
| $delete_handling | ID_TEXT | No | No | required parameter | delete leave | N/A | Delete handling method |
| $update_handling | ID_TEXT | No | No | required parameter | overwrite freshen skip delete | N/A | Update handling method |
| $meta_keywords_field | ID_TEXT | No | No | required parameter | N/A | N/A | Meta keywords field (blank: none) |
| $meta_description_field | ID_TEXT | No | No | required parameter | N/A | N/A | Meta description field (blank: none) |
| $notes_field | ID_TEXT | No | No | required parameter | N/A | N/A | Notes field (blank: none) |
| $allow_rating | boolean | No | No | required parameter | N/A | N/A | Whether rating is allowed for this resource |
| $allow_comments | boolean | No | No | required parameter | N/A | N/A | Whether comments are allowed for this resource |
| $allow_trackbacks | boolean | No | No | required parameter | N/A | N/A | Whether trackbacks are allowed for this resource |
| $spreadsheet_path | PATH | No | No | required parameter | N/A | N/A | The path of the file to import |
| $filename | ?string | No | No | Null | N/A | N/A | The filename of the file to import (null: detect from $spreadsheet_path) |
Returns
- A tuple of at least 2: Return mime-type, content (either Tempcode, or a string, or a filename and file-path pair to a temporary file), map of HTTP headers if transferring immediately, map of ini_set commands if transferring immediately (null: show standard success message)
- Type: ?array
- Set: N/A
- Range: N/A
Preview
Code (PHP)
/**
* Run the task hook.
*
* @param ID_TEXT $catalogue_name The name of the catalogue that was used
* @param string $key_field The title of the key field (blank: none)
* @param ID_TEXT $new_handling New handling method
* @set skip add
* @param ID_TEXT $delete_handling Delete handling method
* @set delete leave
* @param ID_TEXT $update_handling Update handling method
* @set overwrite freshen skip delete
* @param ID_TEXT $meta_keywords_field Meta keywords field (blank: none)
* @param ID_TEXT $meta_description_field Meta description field (blank: none)
* @param ID_TEXT $notes_field Notes field (blank: none)
* @param boolean $allow_rating Whether rating is allowed for this resource
* @param boolean $allow_comments Whether comments are allowed for this resource
* @param boolean $allow_trackbacks Whether trackbacks are allowed for this resource
* @param PATH $spreadsheet_path The path of the file to import
* @param ?string $filename The filename of the file to import (null: detect from $spreadsheet_path)
* @return ?array A tuple of at least 2: Return mime-type, content (either Tempcode, or a string, or a filename and file-path pair to a temporary file), map of HTTP headers if transferring immediately, map of ini_set commands if transferring immediately (null: show standard success message)
*/
public function run(string $catalogue_name, string $key_field, string $new_handling, string $delete_handling, string $update_handling, string $meta_keywords_field, string $meta_description_field, string $notes_field, bool $allow_rating, bool $allow_comments, bool $allow_trackbacks, string $spreadsheet_path, ?string $filename = null) : ?array
* Run the task hook.
*
* @param ID_TEXT $catalogue_name The name of the catalogue that was used
* @param string $key_field The title of the key field (blank: none)
* @param ID_TEXT $new_handling New handling method
* @set skip add
* @param ID_TEXT $delete_handling Delete handling method
* @set delete leave
* @param ID_TEXT $update_handling Update handling method
* @set overwrite freshen skip delete
* @param ID_TEXT $meta_keywords_field Meta keywords field (blank: none)
* @param ID_TEXT $meta_description_field Meta description field (blank: none)
* @param ID_TEXT $notes_field Notes field (blank: none)
* @param boolean $allow_rating Whether rating is allowed for this resource
* @param boolean $allow_comments Whether comments are allowed for this resource
* @param boolean $allow_trackbacks Whether trackbacks are allowed for this resource
* @param PATH $spreadsheet_path The path of the file to import
* @param ?string $filename The filename of the file to import (null: detect from $spreadsheet_path)
* @return ?array A tuple of at least 2: Return mime-type, content (either Tempcode, or a string, or a filename and file-path pair to a temporary file), map of HTTP headers if transferring immediately, map of ini_set commands if transferring immediately (null: show standard success message)
*/
public function run(string $catalogue_name, string $key_field, string $new_handling, string $delete_handling, string $update_handling, string $meta_keywords_field, string $meta_description_field, string $notes_field, bool $allow_rating, bool $allow_comments, bool $allow_trackbacks, string $spreadsheet_path, ?string $filename = null) : ?array

