ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilBiblTypeFactory Class Reference

Class ilBiblTypeFactory. 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

Member Function Documentation

◆ convertFileEndingToDataType()

ilBiblTypeFactory::convertFileEndingToDataType ( string  $file_ending)

Implements ilBiblTypeFactoryInterface.

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

References ilBiblTypeFactoryInterface\DATA_TYPE_BIBTEX, and ilBiblTypeFactoryInterface\DATA_TYPE_RIS.

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  }

◆ getDataTypeIdentifierByInstance()

ilBiblTypeFactory::getDataTypeIdentifierByInstance ( ilBiblTypeInterface  $type_inst)

Implements ilBiblTypeFactoryInterface.

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

References ilBiblTypeFactoryInterface\DATA_TYPE_BIBTEX, and ilBiblTypeFactoryInterface\DATA_TYPE_RIS.

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

◆ getInstanceForFileName()

ilBiblTypeFactory::getInstanceForFileName ( string  $filename)

Implements ilBiblTypeFactoryInterface.

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

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

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  }
Interface ilBiblTypeInterface.
$filename
Definition: buildRTE.php:89
+ Here is the call graph for this function:

◆ getInstanceForString()

ilBiblTypeFactory::getInstanceForString ( string  $string)

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  }
Class ilBibTexInterface.
Class ilRisInterface.
Definition: class.ilRis.php:9
Interface ilBiblTypeInterface.

◆ getInstanceForType()

ilBiblTypeFactory::getInstanceForType ( int  $type)

Implements ilBiblTypeFactoryInterface.

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

References ilBiblTypeFactoryInterface\DATA_TYPE_BIBTEX, and ilBiblTypeFactoryInterface\DATA_TYPE_RIS.

Referenced by getInstanceForFileName().

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
Class ilBibTexInterface.
Class ilRisInterface.
Definition: class.ilRis.php:9
Interface ilBiblTypeInterface.
+ Here is the caller graph for this function:

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