ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
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 79 of file class.ilBiblTypeFactory.php.

References ilBiblTypeFactoryInterface\DATA_TYPE_BIBTEX, and ilBiblTypeFactoryInterface\DATA_TYPE_RIS.

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  }

◆ getDataTypeIdentifierByInstance()

ilBiblTypeFactory::getDataTypeIdentifierByInstance ( ilBiblTypeInterface  $type_inst)

Implements ilBiblTypeFactoryInterface.

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

References ilBiblTypeInterface\getId().

95  : int
96  {
97  return $type_inst->getId();
98  }
+ Here is the call graph for this function:

◆ getInstanceForFileName()

ilBiblTypeFactory::getInstanceForFileName ( string  $filename)

Implements ilBiblTypeFactoryInterface.

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

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

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