ILIAS  release_8 Revision v8.24
ilBiblTypeFactory Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. 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

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Class ilBiblTypeFactory

Author
Fabian Schmid fs@st.nosp@m.uder.nosp@m.-raim.nosp@m.ann..nosp@m.ch

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

Member Function Documentation

◆ convertFileEndingToDataType()

ilBiblTypeFactory::convertFileEndingToDataType ( string  $file_ending)

@inheritDoc

Implements ilBiblTypeFactoryInterface.

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

79 : int
80 {
81 switch ($file_ending) {
82 case "ris":
84 case "bib":
86 default:
87 throw new ilException("no data type found for this file ending");
88 }
89 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References ilBiblTypeFactoryInterface\DATA_TYPE_BIBTEX, and ilBiblTypeFactoryInterface\DATA_TYPE_RIS.

◆ getDataTypeIdentifierByInstance()

ilBiblTypeFactory::getDataTypeIdentifierByInstance ( ilBiblTypeInterface  $type_inst)

@inheritDoc

Implements ilBiblTypeFactoryInterface.

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

95 : int
96 {
97 return $type_inst->getId();
98 }

References ilBiblTypeInterface\getId().

+ Here is the call graph for this function:

◆ getInstanceForFileName()

ilBiblTypeFactory::getInstanceForFileName ( string  $filename)

@inheritDoc

Implements ilBiblTypeFactoryInterface.

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

47 {
48 //return bib for filetype .bibtex:
49 if (strtolower(substr($filename, -6)) == "bibtex"
50 || strtolower(substr($filename, -3)) == "bib"
51 ) {
53 }
54
55 //else return its true filetype
57 }
$filename
Definition: buildRTE.php:78
getInstanceForType(int $type)
@inheritDoc
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

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 63 of file class.ilBiblTypeFactory.php.

64 {
65 switch ($string) {
66 case "bib":
67 return new ilBibTex();
68 case "ris":
69 return new ilRis();
70 default:
71 throw new ilException("bibliografic type not found");
72 }
73 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: class.ilRis.php:26

◆ getInstanceForType()

ilBiblTypeFactory::getInstanceForType ( int  $type)

@inheritDoc

Implements ilBiblTypeFactoryInterface.

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

30 {
31 assert(is_int($type));
32 switch ($type) {
34 return new ilBibTex();
36 return new ilRis();
37 default:
38 throw new ilException("bibliografic type not found");
39 }
40 }
$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: