ILIAS  trunk Revision v11.0_alpha-1761-g6dbbfa7b760
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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)
 
 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)

Implements ilBiblTypeFactoryInterface.

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

References ilBiblTypeFactoryInterface\DATA_TYPE_BIBTEX, and ilBiblTypeFactoryInterface\DATA_TYPE_RIS.

73  : int
74  {
75  return match ($file_ending) {
78  default => throw new ilException("no data type found for this file ending"),
79  };
80  }

◆ getDataTypeIdentifierByInstance()

ilBiblTypeFactory::getDataTypeIdentifierByInstance ( ilBiblTypeInterface  $type_inst)

Implements ilBiblTypeFactoryInterface.

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

References ilBiblTypeInterface\getId().

86  : int
87  {
88  return $type_inst->getId();
89  }
+ Here is the call graph for this function:

◆ getInstanceForFileName()

ilBiblTypeFactory::getInstanceForFileName ( string  $filename)

Implements ilBiblTypeFactoryInterface.

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

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

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  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$filename
Definition: buildRTE.php:78
+ Here is the call graph for this function:

◆ getInstanceForString()

ilBiblTypeFactory::getInstanceForString ( string  $string)

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

◆ getInstanceForType()

ilBiblTypeFactory::getInstanceForType ( int  $type)

Implements ilBiblTypeFactoryInterface.

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

References ilBiblTypeFactoryInterface\DATA_TYPE_BIBTEX, and ilBiblTypeFactoryInterface\DATA_TYPE_RIS.

Referenced by getInstanceForFileName().

30  {
31  assert(is_int($type));
32  return match ($type) {
35  default => throw new ilException("bibliografic type not found"),
36  };
37  }
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:25
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the caller graph for this function:

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