ILIAS  release_7 Revision v7.30-3-g800a261c036
ilImportDirectoryFactory Class Reference
+ Collaboration diagram for ilImportDirectoryFactory:

Public Member Functions

 __construct ()
 ilImportDirectoryFactory constructor. More...
 
 getInstanceForComponent (string $type)
 

Data Fields

const TYPE_MOB = 'mob'
 
const TYPE_SAHS = 'sahs'
 
const TYPE_EXPORT = 'export'
 

Protected Attributes

 $logger
 
 $storage
 

Detailed Description

Definition at line 5 of file class.ilImportDirectoryFactory.php.

Constructor & Destructor Documentation

◆ __construct()

ilImportDirectoryFactory::__construct ( )

ilImportDirectoryFactory constructor.

Definition at line 24 of file class.ilImportDirectoryFactory.php.

25 {
26 global $DIC;
27
28 $this->logger = $DIC->logger()->exp();
29 $this->storage_directory = $DIC->filesystem()->storage();
30 }
global $DIC
Definition: goto.php:24

References $DIC.

Member Function Documentation

◆ getInstanceForComponent()

ilImportDirectoryFactory::getInstanceForComponent ( string  $type)
Parameters
string$type
Returns
ilImportDirectory
Exceptions
InvalidArgumentException

Definition at line 37 of file class.ilImportDirectoryFactory.php.

38 {
39 switch ($type) {
40 case self::TYPE_MOB:
41 $instance = new ilMediaObjectImportDirectory(
42 $this->storage_directory,
43 $this->logger
44 );
45 break;
46
47 case self::TYPE_SAHS:
48 $instance = new ilScormImportDirectory(
49 $this->storage_directory,
50 $this->logger
51 );
52 break;
53
55 $instance = new ilExportImportDirectory(
56 $this->storage_directory,
57 $this->logger
58 );
59 break;
60
61 default:
62 $this->logger->error('Invalid type given: ' . $type);
63 throw new InvalidArgumentException(
64 'Invalid type given: ' . $type
65 );
66 }
67 return $instance;
68 }
Import directory interface.
$type

References $type, TYPE_EXPORT, TYPE_MOB, and TYPE_SAHS.

Field Documentation

◆ $logger

ilImportDirectoryFactory::$logger
protected

Definition at line 14 of file class.ilImportDirectoryFactory.php.

◆ $storage

ilImportDirectoryFactory::$storage
protected

Definition at line 19 of file class.ilImportDirectoryFactory.php.

◆ TYPE_EXPORT

const ilImportDirectoryFactory::TYPE_EXPORT = 'export'

◆ TYPE_MOB

◆ TYPE_SAHS

const ilImportDirectoryFactory::TYPE_SAHS = 'sahs'

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