ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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 73 of file class.ilBiblTypeFactory.php.

73 : int
74 {
75 return match ($file_ending) {
78 default => throw new ilException("no data type found for this file ending"),
79 };
80 }
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 86 of file class.ilBiblTypeFactory.php.

86 : int
87 {
88 return $type_inst->getId();
89 }

References ilBiblTypeInterface\getId().

+ Here is the call graph for this function:

◆ getInstanceForFileName()

ilBiblTypeFactory::getInstanceForFileName ( string  $filename)

@inheritDoc

Implements ilBiblTypeFactoryInterface.

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

44 {
45 //return bib for filetype .bibtex:
46 if (strtolower(substr($filename, -6)) === "bibtex"
47 || strtolower(substr($filename, -3)) === "bib"
48 ) {
50 }
51
52 //else return its true filetype
54 }
$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 60 of file class.ilBiblTypeFactory.php.

61 {
62 return match ($string) {
63 "bib" => new ilBibTex(),
64 "ris" => new ilRis(),
65 default => throw new ilException("bibliografic type not found"),
66 };
67 }
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 return match ($type) {
35 default => throw new ilException("bibliografic type not found"),
36 };
37 }

References 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: