ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilBiblTypeFactory Class Reference

Class ilBiblTypeFactory. More...

+ Inheritance diagram for ilBiblTypeFactory:
+ Collaboration diagram for ilBiblTypeFactory:

Public Member Functions

 getInstanceForType (int $type)
 @inheritDoc More...
 
 getInstanceForFileName (string $filename)
 @inheritDoc More...
 
 getInstanceForString (string $string)
 @inheritDoc More...
 
 convertFileEndingToDataType (string $file_ending)
 @inheritDoc More...
 
 getDataTypeIdentifierByInstance (ilBiblTypeInterface $type_inst)
 @inheritDoc More...
 
 getInstanceForType (int $type)
 
 getInstanceForFileName (string $filename)
 
 getInstanceForString (string $string)
 
 convertFileEndingToDataType (string $file_ending)
 
 getDataTypeIdentifierByInstance (ilBiblTypeInterface $type_inst)
 

Additional Inherited Members

- Data Fields inherited from ilBiblTypeFactoryInterface
const DATA_TYPE_RIS = 1
 
const DATA_TYPE_BIBTEX = 2
 

Detailed Description

Member Function Documentation

◆ convertFileEndingToDataType()

ilBiblTypeFactory::convertFileEndingToDataType ( string  $file_ending)

@inheritDoc

Implements ilBiblTypeFactoryInterface.

Definition at line 64 of file class.ilBiblTypeFactory.php.

64 : int
65 {
66 switch ($file_ending) {
67 case "ris":
69 break;
70 case "bib":
72 break;
73 default:
74 throw new ilException("no data type found for this file ending");
75 }
76 }
Base class for ILIAS Exception handling.

References ilBiblTypeFactoryInterface\DATA_TYPE_BIBTEX, and ilBiblTypeFactoryInterface\DATA_TYPE_RIS.

◆ getDataTypeIdentifierByInstance()

ilBiblTypeFactory::getDataTypeIdentifierByInstance ( ilBiblTypeInterface  $type_inst)

@inheritDoc

Implements ilBiblTypeFactoryInterface.

Definition at line 82 of file class.ilBiblTypeFactory.php.

82 : int
83 {
84 if ($type_inst instanceof ilRis) {
86 } elseif ($type_inst instanceof ilBibTex) {
88 }
89 }
Class ilBibTexInterface.
Class ilRisInterface.
Definition: class.ilRis.php:10

References ilBiblTypeFactoryInterface\DATA_TYPE_BIBTEX, and ilBiblTypeFactoryInterface\DATA_TYPE_RIS.

◆ getInstanceForFileName()

ilBiblTypeFactory::getInstanceForFileName ( string  $filename)

@inheritDoc

Implements ilBiblTypeFactoryInterface.

Definition at line 31 of file class.ilBiblTypeFactory.php.

32 {
33 //return bib for filetype .bibtex:
34 if (strtolower(substr($filename, -6)) == "bibtex"
35 || strtolower(substr($filename, -3)) == "bib"
36 ) {
38 }
39
40 //else return its true filetype
42 }
$filename
Definition: buildRTE.php:89
getInstanceForType(int $type)
@inheritDoc
Interface ilBiblTypeInterface.

References $filename, ilBiblTypeFactoryInterface\DATA_TYPE_BIBTEX, ilBiblTypeFactoryInterface\DATA_TYPE_RIS, and getInstanceForType().

+ Here is the call graph for this function:

◆ getInstanceForString()

ilBiblTypeFactory::getInstanceForString ( string  $string)

@inheritDoc

Implements ilBiblTypeFactoryInterface.

Definition at line 48 of file class.ilBiblTypeFactory.php.

49 {
50 switch ($string) {
51 case "bib":
52 return new ilBibTex();
53 case "ris":
54 return new ilRis();
55 default:
56 throw new ilException("bibliografic type not found");
57 }
58 }

◆ getInstanceForType()

ilBiblTypeFactory::getInstanceForType ( int  $type)

@inheritDoc

Implements ilBiblTypeFactoryInterface.

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

15 {
16 assert(is_int($type));
17 switch ($type) {
19 return new ilBibTex();
21 return new ilRis();
22 default:
23 throw new ilException("bibliografic type not found");
24 }
25 }
$type

References $type, ilBiblTypeFactoryInterface\DATA_TYPE_BIBTEX, and ilBiblTypeFactoryInterface\DATA_TYPE_RIS.

Referenced by getInstanceForFileName().

+ Here is the caller graph for this function:

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