GRIS_IMPORT
in package
Class to manage imports
With this class imports can be managed
PHP version 8
Copyright (c) 2024, Holger Heuser, GESIS Leibniz Institute for the Social Sciences Unter Sachsenhausen 6-8 50667 Cologne, Germany
Tags
Table of Contents
- dbtable = 'gris_import'
- The constant for the database table
- settings_group = "import"
- The constant for the settings group
- $classname : object
- The name of the class
- $dbconnection : object
- The database object for managing the connection
- $i18n : object
- The object for translations
- $import : object
- The object for institutes
- $settings : object
- The object for settings
- $state : object
- The object for logs
- __construct() : mixed
- The class constructor
- delete_import() : array<string|int, mixed>
- Returns a list of data for all stored imports (or optional for a single import identified by its ID)
- execute_import() : mixed
- Execute the import
- get_filter() : array<string|int, mixed>
- Returns the attribute filter for this import
- get_import_list() : array<string|int, mixed>
- Returns a list of data for all stored imports (or optional for a single import identified by its ID)
- import_preprocess() : Returns
- Run the import preprocess
- is_doi() : mixed
- set_import() : Returns
- Create a new import
Constants
dbtable
The constant for the database table
public
mixed
dbtable
= 'gris_import'
settings_group
The constant for the settings group
public
mixed
settings_group
= "import"
Properties
$classname
The name of the class
protected
object
$classname
= NULL
Tags
$dbconnection
The database object for managing the connection
private
object
$dbconnection
= NULL
Tags
$i18n
The object for translations
private
object
$i18n
Tags
$import
The object for institutes
private
object
$import
= array()
Tags
$settings
The object for settings
private
object
$settings
= null
Tags
$state
The object for logs
private
object
$state
Tags
Methods
__construct()
The class constructor
public
__construct() : mixed
Initializes the objects
Return values
mixed —delete_import()
Returns a list of data for all stored imports (or optional for a single import identified by its ID)
public
delete_import(int $id) : array<string|int, mixed>
Parameters
- $id : int
-
The import ID (to filter a special import)
Return values
array<string|int, mixed> —Returns the data of the imports (or of a single import)
execute_import()
Execute the import
public
execute_import(int $import_id[, string $source = NULL ]) : mixed
Parameters
- $import_id : int
-
The import ID
- $source : string = NULL
-
The foreign ID or the filename for the import
Return values
mixed —Returns the preprocessed import data oder (booelan) false on error
get_filter()
Returns the attribute filter for this import
public
get_filter(int $id) : array<string|int, mixed>
Parameters
- $id : int
Return values
array<string|int, mixed> —Returns the attributes as an array
get_import_list()
Returns a list of data for all stored imports (or optional for a single import identified by its ID)
public
get_import_list([int $id = NULL ][, bool $short = false ]) : array<string|int, mixed>
Parameters
- $id : int = NULL
-
The import ID (to filter a special import)
- $short : bool = false
-
Return only the short version (name => ID with flag)
Return values
array<string|int, mixed> —Returns the data of the imports (or of a single import)
import_preprocess()
Run the import preprocess
public
import_preprocess(string $preprocess, bool $source) : Returns
Parameters
- $preprocess : string
-
The name of the preprocess to use
- $source : bool
-
The URL or the filename for the import
Return values
Returns —the preprocessed import data oder (booelan) false on error
is_doi()
public
is_doi(mixed $doi) : mixed
Parameters
- $doi : mixed
Return values
mixed —set_import()
Create a new import
public
set_import(array<string|int, mixed> $data) : Returns
Parameters
- $data : array<string|int, mixed>
-
The import data (only update if ID)
Return values
Returns —the current ID on success and false on error